User Tools

Site Tools


Sidebar

tutorials:server:migration:start

Installation Migration

With all of our auction and classified software products you can move the complete installation from one directory on the same domain to another directory rather easily. There are a few things that will need to be updated when you change the directory, which are listed below in each of the steps.

This tutorial actually covers a variety of different situations:

  • Server Migration (meaning copying from one server to another) : Follow all steps <
  • Move installation to a different folder on the same server : Skip step 2 <
  • Create test installation : Follow all steps, see note below. <
  • Domain change only1) : Use the reduced steps in the tutorial for Changing The Domain Name2) <

If you aren't sure which instructions to follow for your situation, when in doubt ask support! Support can tell you exactly which instructions you should be using for your situation.

NOTE: We provide these steps to allow you to perform the migration (moving the software to be installed in a different location) yourself. However if you would prefer us to make the move for you, we do offer professional server migration service which you can purchase from the client area.

<tip c n>Note for Test Installations: This tutorial will also work when creating a duplicate installation for development, staging, or testing purposes. Note though that you are creating two separate and autonomous installations when you do so. This means two separate file locations and two separate databases. Each file set connecting to it's own database. This is irrespective of whether the test installation is on a different server, the same server and/or the same domain than the live installation. Each is a standalone copy of the other installation when finished. Just note NOT to delete the original installation if you are just creating the copy for development/testing/staging purposes.</tip>

Step 0 - Preparation

Make sure you perform the move on a weekday, since Geodesic Solutions will need to update the installation location for your license key. If you try to move over the weekend you will have to wait until Monday before you can use the new location since our offices are only open normal business hours, Monday through Friday.

In your admin panel, go to Site Setup > Cache and turn cache off if it is currently turned on. It will make for less files to have to copy, and will make sure any cached data that contains the old folder location from causing problems, such as template file locations since those locations are cached.

We highly recommend to turn your site "off" during the move, to prevent users from placing listings with images after you have already transfered the files, so that the images don't make it in the move. You can do so using the setting Site Setup > General Settings > Site On/Off Switch.

Step 1 - Move Files

<tip c n>Note: In this step, whenever it says FTP or FTP software, you can alternatively use SFTP if your host supports this, the instructions are exactly the same whether you use FTP or SFTP. If your host supports it, we recommend SFTP as that is more secure.</tip>

This is the main step, moving the files from one directory to another. There are 3 different ways to accomplish this, 2 listed below, just choose the option that best fits your situation.

Option 1 is only if the folder is simply being re-named.

Option 2 is standard option for moving files from one place to another, using FTP.

Option 3 (located on it's own page) uses SSH to zip then SCP the files from one server to the other. This option is only for advanced users that are comfortable with using SSH. This option is much faster and more reliable, but also more complicated, and only works if the servers involved support SSH. If you fall into that group, see the magical SSH option at Advance Option: Use SSH / SCP / ZIP to Transfer Files.

Option 1: Folder Rename, on Same Server

If you are simply changing the folder name, all you have to do is re-name the folder using FTP software. Then delete the contents of templates_c/ folder, as there are times when moving the folder can cause those files to need to be re-generated. Keep the folder, but delete the contents of the folder. Once that is complete, you can proceed to Step 2 - Create Database.

Option 2: Use FTP to move from one folder or server to another

This is if you are moving to a new server, or even on the same server but to a different folder; or if you are creating a copy for testing purposes. You will need to move all root files of the software, classes directory, admin directory, images directory, etc… All files within the installation need to move at once with the relative directory structure of the files to one another kept the same. You can do this by downloading all files at once within your FTP program by selecting all and clicking to download all at once. When you are downloading, make sure you have the transfer mode set to BINARY to ensure that none of the files get corrupted.

Once all files are downloaded double check your FTP software to ensure it did not report any "errors" during download process, you want to make sure all the files downloaded correctly. Once you are sure of that, you can then upload them up to the new location, whether that is on the same server in a different folder, or upload to an entirely different server if you are changing servers. When uploading the files, make sure your FTP software has the transfer mode set to BINARY to avoid file corruption.

In the new folder location, you will need to make sure the sub-folders listed below and all of the folders' contents are "writable", usually this means to CHMOD 777 the folder and contents:

  • user_images/ (or whatever folder you use for uploaded images in classifieds or auctions)<
  • templates_c/<
  • _geocache/<
  • geo_templates/<

And finally, you will need to delete all the files in the templates_c/ folder, as there are times when moving the folder can cause those files to need to be re-generated. Keep the folder, but delete the contents of the folder.

<tip c n>Tip: If, after your site has moved from one location to another, you see a "SmartyException" error, it typically means this last step above was skipped. In that case, deleting all files in the templates_c folder will usually clear the error.</tip>

Once that is complete, continue to the next step Step 2 - Create Database

Step 2 - Create Database

You can skip this step if staying on the same server, and the old location is going away. Do NOT skip if you are making a copy for testing purposes, your test installation will need it's own copy of the database!

In the location you are copying or moving the installation to, basically copy your existing database to the new installation location then update the config.php in the new location to use the new database. Below we go into more detail for those that are not familiar with this process:

First, on the new location, create a new database. Usually this is done through the hosting control panel.

Next, create a backup (sometimes called a DB dump) of the "from" database, that includes both "structure" and "data". Most hosts provide a program called phpMyAdmin for administering your MySQL databases of your hosting account. You will want to use phpMyAdmin to create a backup of the database of the old installation in SQL format. Many times hosts have built in "database backup" features but the output created by these types of backups usually require specific software to restore. You can try the backup created, but if it does not work use the SQL output from phpmyadmin for creating your backup instead of any host specific or proprietary backup systems.

<tip c n>Note: Be sure to use the Drop Table option as it makes recreating the database a bit easier.</tip>

Once you have created the DB backup or dump of the "from" database, import that into the "to" database. You can use PHPMyAdmin for this on the "to" location, there is a tool that allows you to import SQL files. Use that tool to import the SQL file created from the "from" database.

Moving the database over from the old installation to the new installation "moves" all the changes, configurations and settings you made through the old installations admin tool into the new installation. Consult your host's support documentation as they should provide help documents regarding using phpmyadmin.

And last, in the "new" location, edit the config.php file, and change the section regarding the database settings. They must be set to use the "new" database information.

Step 3 - Update License Key

<tip c n>Note: If you created a new database in the last step, you updated your config.php file on the new location, right? If not, do that now, the config.php on the new location needs to have the DB information for the new location in it.</tip>

Log into your admin panel in the new installation location and it will show the license key page, usually with an error message saying that the installation folder does not match. On the page it will list the detected installation folder and the installation domain, copy and paste this data exactly as it appears in the admin panel, and send it to [email protected] with the title of License Update Request so that it gets routed to the correct personnel as fast as possible. They will let you know if any further information is needed.

Note for test installations: If you have the newer GeoCore license, your license comes with 2 slots, one for the normal installation and one for a test installation. If you have not already used both slots, when you log into the admin panel you will have the option to continue using your existing license without having to contact us. After the 2nd installation location though, you must contact us to add new locations to your license or update existing locations.

Step 4 - Software Settings

The following settings will need to be updated in your admin panel, to reflect the new installation folder:

Then in Email Setup > General Settings you may need to adjust the e-mail settings to make e-mails work on the new location. This is mainly a concern if changing servers, but it is still a good idea regardless, to send a test e-mail to yourself to make sure e-mail is working.

Test installations Only: In the admin at Email Setup > Notification E-mail Settings, turn off all notifications! Otherwise your test installation may send out e-mail notices to your "real" users since the test installation is based on copy of the live installation database. If you run auctions, you may also want to disable the addon Main E-mail Sender and that will disable the ability for the test installation from sending any e-mails (since auctions will send notifications beyond what you can disable normally).

Within the default design all HTML links are relative to the base directory of the installation, so they will dynamically be correct when the move is complete. However, if you have gone into any page templates or sub-templates and edited them placing absolute links within the software then these will need to be modified to reflect the new location. You can follow the instructions in this step to update any such links. If you are absolutely sure that you have not added any absolute links or image locations you can skip this step, however we still recommend at least double checking to make sure there are not any places found.

Go to Design > Text Search and search for the old installation folder, as it would be used in a link or image tag. For example if your old installation folder was in www.example.com/old_folder/ you would do a search for "old_folder" without the quotes. Start with the first search results tab, Pages/Modules Text, and click the button to edit text for each of the places that the old folder location is found. Make sure the WYSIWYG editor is turned off, and update any places in the text that use the old installation, to use the new one instead.

Keep doing this for each of the found results for Pages/Modules Text, then move on to Addon Text and repeat the process if any are found. Once you are through with addon text, repeat the process for Template Contents search results, when editing templates make sure to use the <..> Source Code Editor tab in the template editor.

<tip c n>Note: If you have multiple template sets, or sometimes if you have design mode set to advanced, when you attempt to edit a template it may give the error similar to:

File is from (my_templates) which is not within the current template sets being edited.

If this happens, on the page in the top left next to Template Set: ___ click the change button, and select the template set that the template is in that you are trying to edit. Once the page re-loads, you will be able to edit the template just fine.</tip>

Step 6 - Uploaded Images Location

One thing that cannot be updated by changing the setting in the admin panel, is the "full image folder" stored in the database for existing images. That folder path must be updated "by hand" in the database, otherwise it will remove images from the original location which is a very bad thing if you are making a test installation!

If the installation you are moving or copying does not have any images in the "user_images" folder, you can skip this step. Everyone else, you need to follow this step, especially those that are creating a test installation on the same server.

First, make sure you back up your database prior to running this query, in case anything goes wrong. If something does go wrong, restore the backup. Support will not be able to do anything if you have not created a backup and something goes wrong3)

Using PHPMyAdmin, manually run the following SQL query on the new installation's database (adjustments required, as noted below):

UPDATE `geodesic_classifieds_images_urls` SET `file_path`='/new/absolute/server/path/to/user_images/' WHERE `file_path`='/old/absolute/server/path/to/user_images/';

In the query above, you would replace the /new/absolute/server/path/to/user_images/ with the new value for the Server Path to Root of Photos Directory setting, and replace /old/absolute/server/path/to/user_images/ with the previous value set in the same setting for the "old" installation.

If it says 0 rows affected, check to make sure you have set both values correctly.

<tip c n>Test Installation Tip: If you created a copy of your site for "testing" purposes, and did not follow this step when you originally created your test installation, the test installation may be deleting images from your live website before they should be deleted, even if the "live" version of the listing has not expired yet!

If this happened for your site: First, follow this step for your test installation to keep it from happening in the future. Second, copy all of the images from your test installation user_images/ folder, to your live installation user_images/ folder, and you can skip images that already exist. This will restore any images that were deleted by not following this step to begin with! Then in the live installation, you can use the tool to remove orphaned images to get rid of images that do actually need to be moved. If that tool is not able to remove the images, you may need to CHMOD 777 all files in the user_images folder on your live site so that the software can delete them.</tip>

Step 7 - SEO Addon

If you use the SEO addon to rewrite your URLs to more Search Engine friendly ones you may need to recreate the "rewrite rules" within your .htaccess file to reflect the new location. If you do not use SEO addon you can skip this step.

In your admin, go to Addons > SEO > General Settings and click on Apply All Settings, then Yes. Then copy/paste the generated .htaccess file contents, and paste into your .htaccess file in the new installation location.

Last Step - Cleanup

After you are sure that everything is working in the new location you can remove the files in the old installation location if you are moving installations. If this is a test installation, obviously you keep your old installation files since that goes to your live website.

If you wish to use cache, you can turn the cache on at Site Setup > Cache since it should have been turned it off prior to the move (in step "0" above).

If you elected to turn your site off during the move, don't forget to turn your site back "on"! You can do so at Site Setup > General Settings#Site On/Off Switch.

Test Installations: If you are creating a test installation, we also recommend to turn all e-mail notifications off in the admin at E-mail Setup > Notification E-Mail Settings, that way it does not generate e-mails to users resulting in duplicate e-mails sent since the main installation would also be sending it's own notices. Make sure you do not turn the notices on in the future, as that will generate "past notices" to be sent in certain cases.

1)
Files do not move to a new location, and database is not moving.
2)
Note that the linked tutorial is actually this tutorial, with only step 3, step 4, step 5, and step 7.
3)
For instance, if you somehow delete a table by accident, support would have no way at all to restore that table with all the data it had. So make sure you backup the database first!
tutorials/server/migration/start.txt · Last modified: 2014/09/25 16:55 (external edit)