How to migrate MYSQL to a new Windows server
Here is the easiest process that I know of for migrating (and upgrading) from one version of MYSQL running on Windows server, to a new Windows server.
- Setup the new Windows server, give it a fixed IP address (we’ll change that later to be at the same IP as the old server).
- Run all Windows updates
- Install IIS 7.5 (in our example, we were on W2K8 R2 Standard) and take all defaults.
- Go to Google and search for MICROSOFT PLATFORM INSTALLER, go to that Microsoft site, and run the installer. The current version as of this post was 4.0RC
- in the MPI, search for PHP and install PHP. Allow it to take any extras it chooses, hit next and install those items.
- Now that PHP is installed, launch the IIS 7.5 manager, stop the default site and setup a new website that we’ll use to park PHPMYADMIN on.
- Go download the latest version of PHPMYADMIN.
- extract it to your website directory into the /phpmyadmin/ directory.
- you should now be able to access the PHPMYADMIN site via http://localhost/phpmyadmin/
- Download and install the latest MSI installer download (of the x64 version if you have an x64 server)
- Install MYSQL
- Run the configuration wizard and complete the standard setup. In our case we used a dedicated MYSQL server, set a new password for the admin account and pretty much took all defaults.
- At this pount we just need to migrate the data over from the old server to the new server.
- Make sure you have MYSQL Workbench installed to do this (under windows). Current version is 5.2.30 CE.
- Under “Server Administration” you need to setup one connection for the old (current server) and one for the new one.
- Connect to the old server.
- Click Data Export.
- Export out ALL databases to one SQL file. This may take some time depending on the speed of your internet connection.
- when this is complete, go check the file to make sure it is (relatively) large depending on the number of databases that you exported out. MAKE SURE you export out the MYSQL database as well as all databases.
- Connect to the new server.
- Do a DATA IMPORT/RESTORE and load the SQL file you just exported
- Start the import. Again, this may take some time to complete.
- When complete, the new machine is now a clone of the old machine.
- Shut down the old server.
- Change the IP on the new server to the IP of the old server. Reboot (just to be sure).
- Once the new server is rebooted and it is at the “old IP” any of your sites that connect to MYSQL should now be working once again just as if they were connecting to the old server.
I hope this helps anyone who is in need of migrating/upgrading their Windows-based MYSQL install.