Gecko Technologies
► Resources
► Tech Info ►
Migrating a Website
Steps involved in migrating a Linux/Unix website:
- Prepare:
- Note the addresses of both servers to help during DNS changeover
- Note A, CNAME and MX records for old server
- Plan the best time based on when the least traffic is likely for the typical site visitor
- Locate/compile necessary data: location/login information for control panels/DNS managers/SQL, etc.
- Identify file locations on old and new server
- folder containing website files
- folder containing Apache/web server configuration files
- Determine the best method to handle data synchronization issues on websites that collect data during DNS changeover as some users access the old site and some the new
- Create scripting on old and new sites to allow old site to utilize the database on the new site
- Or, create a note on the old site, possibly replacing index.html, that states that while changes are being made, the site will be unavailable
- Or, if data collected are not time-sensitive or ID-sensitive, allow data collection during migration and copy additional data to new server after complete
- Identify all user and email accounts, and either note old passwords (lower security, more convenient) or create new ones (better security, more follow-up work). Be sure to note if special accounts have been created for data synchronization tools or other uses.
- Move the data:
- Move website configuration files
- If SSH is available, log in to server and copy files directly
- For example, on old server: rsync -a -e 'ssh' /fromfolder/ user@newserveripaddress:/tofolder
- Or, use a good FTP program to copy files to a client, then to the new server
- Move website files (same methods as above)
- Move database data
- Move MySQL data between servers (requires setup of security on both ends, not recommended to move secure data across non-secure connection)
On old server:mysqldump -e -C -q --add-drop-table -u <username on old server> -p <database name on old server> | mysql --host=<hostname of new server> -C -u <username on new server> -p <database name on new server>
- Export data to a flat file on old server, move file to new server, then import (requires SSH access):
On old server:$ mysqldump -p -u username mydatabase > mydata.sql
On new server:$ mysql -p -u username mydatabase < mydata.sql
- Or, utilize the export and import functions in phpMyAdmin, if available
- Or, utilize a third-party migration tool, such as SQLyog Job Agent
- Create user and email accounts on the new server
- Test the site on the new server, accessing it by IP address or by adding an entry to the testing client PC's HOSTS file, to ensure that software version or configuration differences between old and new servers do not cause unexpected difficulties
- Change DNS information
- Create A, CNAME, MX records as necessary. Be sure to create subdomain records if they exist.
- Finish up:
- Set up client email program to retrieve email from new and old IP addresses during DNS changeover. After 48+ hours, remove old server information and update new to reflect domain name.
- Migrate any data collected on old server during transition to new server
- Cancel old hosting plans & contracts
- Undo changes to HOSTS file if done for testing
THIS INFORMATION IS PROVIDED ON AN "AS IS" BASIS AND YOU ACCEPT ALL RISKS FOR ITS USE. MYTECHNOLOGYCENTER.COM AND GECKO TECHNOLOGIES
MAKE NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO ANY MATTER WHATSOEVER. IN NO EVENT SHALL MYTECHNOLOGYCENTER.COM OR
GECKO TECHNOLOGIES BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES.