Auto Backup: restoring a file
5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 26, 2011 (RSS)
By gversion - May 26, 2011
I have tried to restore my database by importing the file that the Auto Backup plug-in script has created directly into phpMyAdmin. For example the following file is being imported:
cms-v2.06-hourly-17.sql.php.gz
The result is all the tables being successfully imported but with the table prefix as:
#TABLE_PREFIX#_
So for example, the following table names are created:
#TABLE_PREFIX#_accounts
#TABLE_PREFIX#_categories
...
#TABLE_PREFIX#_uploads
Is there a setting somewhere in the script for me to define what the table prefix should actually be or do I just need to rename the tables manually?
Thinking about this more, perhaps this has been done on purpose to avoid overwriting the original tables? Or is it a bug in the script? :)
Thanks for your help guys.
Greg
Re: [gversion] Auto Backup: restoring a file
By Jason - May 26, 2011
We use TABLE_PREFIX to allow you to have more than 1 CMS Builder installation use the same database without data getting mixed up between the two. By default, the table prefix is cms_. You can find out what you table prefix is by looking at General Settings.
The backup script creates a file that is only meant to be restored through CMS Builder in General Settings. This is the recommended way of restoring your CMS Builder databases.
Is there a reason why you need to restore this directly through phpMyAdmin?
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Auto Backup: restoring a file
By gversion - May 26, 2011
Thanks for the response.
I didn't realise I could restore via the cmsAdmin area...
I was using phpMyAdmin in order to test that the data was being backed up correctly. I wanted to perform a test restore so I created a brand new database (as I didn't want to overwrite anything) and then imported the backup file.
So are you saying that I can restore the backup file on my **LIVE WEBSITE** using the cmsAdmin control panel and the MySQL data won't get overwritten because the restored files will have a different table prefix?
Thanks for clarifying :)
Regards,
Greg
Re: [gversion] Auto Backup: restoring a file
By Jason - May 26, 2011
Your table prefix doesn't change. You only have 1 table prefix for each installation. CMS Builder takes care of handling the table prefix, so it isn't something you need to worry about.
However, if you do a restore through CMS Builder, you WILL overwrite all of the data currently stored for that installation. The restore script first empties out your tables, then re-populates them with the data in the backup file.
If you log into CMS Builder, go to General Settings, you'll see a section with a list of your current backup files. You can select 1 and hit restore to restore that data.
Hope this helps clarify.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Auto Backup: restoring a file
By gversion - May 26, 2011
Very useful to know. Thanks so much for explaining how that works.
Regards,
Greg