At some time, many of us will need to move a CMSB web site from one server to another. With recent versions of CMSB it's become much easier to move an installation:
There are a lot of details here, but the process is pretty straight forward. Just remember backups are the key to success.
- Back up your CMSB database Admin > General > Database Backup > all database tables.
- Download your entire CMSB cmsAdmin folder.
- Add the current version number to the folder name so it won’t be overwritten and you can re-upload it if the upgrade fails.
- Upgrade your CMSB installation to the latest version. NOTE: if you're using the membership plugin, and upgrading from a version prior to V2.08, remember that the encrypted passwords in version 2.08 and later mean you'll have to update a number of your viewers. (See the recipes for the Website Membership plugin for more on this)
- Back up your new upgraded database Admin > General > Database Backup > all database tables.
- Make sure that you can easily identify the latest database backup by the file name, since time stamps will be overwritten when you download the backups (you can safely change the filename as long as you leave the original extension in tact).
- Make sure that all your plugins are up to date for the new PHP and CMSB versions.
- Make sure that everything works.
- Download your entire upgraded site including the CMSB cmsAdmin folder again.
- You can (and should) have more than one installation of CMSB during transfers, staging, etc., so I wouldn't delete any information from your old server until you're sure that things are working on the new one.
- Make sure that there are no references to an older version of PHP in any php.ini files that you’ve copied.
- If possible, create the database on the new server with the same parameters, users and passwords as the old one.
- Create an identical file structure on your new server if possible. Locations get tricky because different ISPs servers have different folder structures and may have a separate server for databases, but you should be able to work it through. Just keep track of any differences, because "The Devil will be in the Details".
NOTE: I usually create a separate subdirectory in my public_html folder with the name of each domain hosted on that account (minus the tld (.com, .org, etc.), and then use an .htaccess file to redirect visitors to the appropriate subfolder. (Suggested code below).
- Assign your domain to the new server. This will probably require un-assigning it from the old server.
- NOTE: Reassignment can take a while due to hosting schedules and propagation issues, so choose a time that you expect less site traffic.
- WARNING: Make sure you have a record of all the existing cron jobs, email accounts and email forwards since they will be deleted on an unassign.
- NOTE: If you decide to place your site files in a sub folder, before you upload your entire site, 1) place similar test index.html files that says something like: "yoursite.com is currently down for maintenance and should be back up shortly" in the public_html folder and the new subfolder, 2) Add some indication to each of the files so you can tell which location you're accessing. and 3) Make sure that you can access the one in the subfolder with the .htaccess method.
- I had some difficulty using the subfolder and .htaccess method above for a single domain hosted on a Bluehost server, and ended up having to put all of the web files directly into the public_html folder, but hopefully your experience will differ. (Most tech support is not very forthcoming when sorting out .htaccess issues.)
- Upload the entire domain directory to your new server’s public_html folder or your subfolder.
- Remove the /cmsAdmin/data/isInstalled.php file from your new server
- Run admin.php and fill out the install screen
- NOTE: If you get an error message about upload folder paths when you try to access the admin.php file, open the data/settings.dat file from the new site, enter the correct value, then re-upload
- Select "Restore Backup" instead of "Create Admin User" to restore the site data from an existing database (the latest backup).
- Using the code generator, check the path to cmsAdmin/lib/viewer_functions.php in your test viewer. If it's different from that on your old viewer pages, you'll have to change them all and re-upload your revised files.
- Check any path specific information in your viewers, javascript or other external files and correct accordingly.
- Set up all new cron Jobs, email forwards and email accounts on the new server account.
- Look over the site carefully to make sure that to make sure that all path names are still valid. There are some entries under the Admin > general tab that may need manual adjustment.
- NOTE: Don’t forget to clear your browser cache and reload any pages before deciding things are broken.
- Check all pages and check all links and includes to make sure that they still work.
- Check forms and other ad-ons and make sure they still work as planned.
If you have any issues that you can't solve, post the specifics on the CMSB forum and you’ll probably get an answer very shortly.
Hope these suggestions make the task of changing servers easier.
# php – Possible .htaccess code. Note that there’s a code block for each tld.
# php -- BEGIN cPanel-generated handler, do not edit (depending on host, this block may vary, or not exist at all) # Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module> AddType application/x-httpd-ea-php72 .php .php7 .phtml </IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?your_domain.com$ RewriteCond %{REQUEST_URI} !^/your_domain/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /your_sub_folder/$1 RewriteCond %{HTTP_HOST} ^(www.)?your_domain.com$ RewriteRule ^(/)?$ your_sub_folder/index.php [L]
RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?your_domain.org$ RewriteCond %{REQUEST_URI} !^/your_sub_folder/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /your_sub_folder/$1 RewriteCond %{HTTP_HOST} ^(www.)?your_domain.org$ RewriteRule ^(/)?$ your_sub_folder/index.php [L]
RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?your_domain.net$ RewriteCond %{REQUEST_URI} !^/your_sub_folder/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /your_sub_folder/$1 RewriteCond %{HTTP_HOST} ^(www.)?your_domain.net$ RewriteRule ^(/)?$ your_sub_folder/index.php [L]
RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?your_domain.info$ RewriteCond %{REQUEST_URI} !^/your_sub_folder/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /your_sub_folder/$1 RewriteCond %{HTTP_HOST} ^(www.)?your_domain.info$ RewriteRule ^(/)?$ your_domain/index.php [L]
|