Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Auto Backup: restoring a file

 

 


gversion
User

May 26, 2011, 11:28 AM

Post #1 of 5 (344 views)
Shortcut
Auto Backup: restoring a file Can't Post

Hello,

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


Jason
Staff / Moderator


May 26, 2011, 1:20 PM

Post #2 of 5 (341 views)
Shortcut
Re: [gversion] Auto Backup: restoring a file [In reply to] Can't Post

Hi Greg,

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 - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


gversion
User

May 26, 2011, 1:28 PM

Post #3 of 5 (339 views)
Shortcut
Re: [Jason] Auto Backup: restoring a file [In reply to] Can't Post

Hi Jason,

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


Jason
Staff / Moderator


May 26, 2011, 1:34 PM

Post #4 of 5 (338 views)
Shortcut
Re: [gversion] Auto Backup: restoring a file [In reply to] Can't Post

Hi Greg,

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 - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


gversion
User

May 26, 2011, 1:45 PM

Post #5 of 5 (337 views)
Shortcut
Re: [Jason] Auto Backup: restoring a file [In reply to] Can't Post

Hi Jason,

Very useful to know. Thanks so much for explaining how that works.

Regards,
Greg