Copying and dupicating a CMSB database

8 posts by 4 authors in: Forums > CMS Builder
Last Post: May 3, 2011   (RSS)

By kkegans - April 19, 2011

I have a need to copy a complete CMSB database to a different domain, using a new CMSB license and restore it in a MYSQL database with different username and password for the new domain. Not being a MYSQL guy, I am lost as to the best way to accomplish this task.


Is this something that can be done, and if so, can a SQL dummy handle the task, or do I need to get this done by the con$ulting team?



Kurt
CMSB Rocks!
Thanks,
Kurt

Re: [kkegans] Copying and dupicating a CMSB database

By robin - April 20, 2011

Hey Kurt,

You can backup your whole database from the General Settings page in CMS Builder. That will create a backup file in your CMS Builder backup folder. Usually: /cmsAdmin/data/backups

Then move the backup file to the new CMS Builder backup folder on the new server. Once the file is copied over you can use the restore festure in General Settings to recover the data.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [kkegans] Copying and dupicating a CMSB database

By gkornbluth - April 20, 2011 - edited: April 20, 2011

Hi Kurt,

Hi I agree with Robin, but that's only a part of the goal that I think that you are trying to accomplish.

Depending on the complexity of your site, this can be a relatively quick process or can take some time. The "Devil" will definitely be in the "details".

Others may have a different, and even easier approach, but here's mine.

First, you'll need to be using the same version of CMS Builder for both domains in order for this to work, so upgrade each install to the latest version before you begin. (remember to back up the database and other CMS files before you upgrade)

Also, you'll need all of the 3rd party programs, CSS files, javascript files, and any other that made the old site work installed on the new site before you proceed. Don't forget to adjust any required information to reflect your new site.

Then:

1) copy all of the .ini.php files from the cmsAdmin/data>schema folder of the old site into the cmsAdmin/data>presets folder of the new site. (these store the complete structure of the old section editors and act as templates for the new site's section editors)

2) create all the section editors in the new site using the choices in the "select preset" list (these are taken from the presets you just copied, so they will have the parameters of the old site editors)

3) Backup the database from the old site using admin>general>database settings>database backup and thencopy the backup .sql.php file from the old cmsAdmin/data/backups folder to the new site in the same directory

4) Restore the copied database to the new site

5) Copy all the images and uploads from your old site's uploads and thumbs sub folders to the new site in the same locations. If you've created special upload locations, copy those over as well.

6) Copy all the web pages from your old to your new site and, using the code generator in your b=new site admin area, adjust the path to the load viewer library file to reflect your new site's path. While you're there, make sure that any absolute link references reference the new site as well.

7) With the possible exception of being able to see images and other uploads on the new site that should do the job

CAN'T SEE IMAGES AND UPLOADS
If the images and uploads don't appear, and there are not many, Id suggest re-uploading the images and uploads to the appropriate records.

If there are a lot of them, read on:

ACCESSING THE IMAGES AND UPLOADS
All upload information is stored in a separate MySQL table called uploads. This table includes path information to the images on your site.

If the path structure is not identical, the images and uploads won't be found and they won't appear on your new site.

UPDATING THE NEW TABLE
First, upload one new image to your new site. This will insert a new record in the uploads table with all the path information for your new site

Then, backup just that table from the new site and adjust the path information to match that new upload's information so your images and uploads will appear on the new site.

This should be pretty easy to do using something like Navicat for MySQL http://mysql.navicat.com/. but if not, there's a step by step description in a recipe in my CMSB Cookbook http://thecmsbcookbook.com that should help called "BATCH UPLOADING OF IMAGES"

Hope that helps get you on your way.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Copying and dupicating a CMSB database

By Toledoh - April 22, 2011

A word of warning. It's been said many times, but be sure to back-up.

The other day I wanted to duplicate a site, but re-skin it for a new client. I simply did my "process" but didn't change some settings. On the new host, I deleted all the first client content ready for the new client content and the new site was still referring to the old database... I deleted all my original clients content on their live site.

Luckily I had backed up a few days earlier and only lost a bit, and the client was fine.

I then purchased thed auto back-up plugin and installed it on all sites!
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Copying and dupicating a CMSB database

Hi Tim,

I couldn't agree more.

Backing up is imperative. Especially before any updates, upgrades, or other mucking about with their data/

I even offer my clients a "Peace of Mind" backup service for all their web based files via FTP, using the "backup jobs" settings in WS-FTP Pro.

I back up all their files once a month for a subscription fee.

So far it's a win-win situation.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [kkegans] Copying and dupicating a CMSB database

By gkornbluth - May 2, 2011

Hi Kurt

Did you ever accomplish your goal?

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [kkegans] Copying and dupicating a CMSB database

By gkornbluth - May 3, 2011

Glad to hear it worked.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php