Home » Categories » Multiple Categories |
How To Migrate a MySQL Database Between Two Servers |
Article Number: 185 | Rating: Unrated | Last Updated: Thu, Dec 26, 2013 at 10:21 PM
|
Transferring a database between virtual private servers can be
accomplished using a SCP (Secure Copy), a method of copying files
derived from the SSH Shell. Keep in mind, you will need to know the
passwords for both virtual servers. In order to migrate the database, there are two steps: Step One—Perform a MySQL DumpBefore transferring the database file to the new VPS, we first need to back it up on the original virtual server by using the mysqldump command.mysqldump -u root -p --opt [database name] > [database name].sqlAfter the dump is performed, you are ready to transfer the database. Step Two—Copy the DatabaseSCP helps you copy the database. If you used the previous command, you exported your database to your home folder.The SCP command has the following syntax: scp [database name].sql [username]@[servername]:path/to/database/A sample transfer might look like this: scp newdatabase.sql user@example.com:~/After you connect, the database will be transferred to the new virtual private server. Step Three—Import the DatabaseOnce the data has been transferred to the new server, you can import the database into MySQL:mysql -u root -p newdatabase < /path/to/newdatabase.sqlWith that, your transfer via SCP will be complete. |
Attachments
![]()
There are no attachments for this article.
|
How To Write a Linux Daemon with Node.js
Viewed 10384 times since Sun, Dec 29, 2013
How To Use WP-CLI to Manage your WordPress Site from the Command Line
Viewed 10350 times since Sat, Jan 4, 2014
How To Install Wordpress on Arch Linux
Viewed 2744 times since Sun, Dec 29, 2013
How To Install and Secure phpMyAdmin on Debian 7
Viewed 3856 times since Fri, Dec 27, 2013
How to Install Piwik on an Ubuntu 12.04 Cloud Server
Viewed 3388 times since Sat, Jan 4, 2014
How To Install Ruby on Rails on Arch Linux with RVM
Viewed 14064 times since Sun, Dec 29, 2013
The Basics of Using the Sed Stream Editor to Manipulate Text in Linux
Viewed 6680 times since Fri, Dec 27, 2013
How To Create a SSL Certificate on Apache for Ubuntu 12.04
Viewed 3489 times since Mon, Dec 23, 2013
How To Create a New User and Grant Permissions in MySQL
Viewed 3449 times since Thu, Dec 26, 2013
How To Use CakePHP to Create a Small Web Application
Viewed 3265 times since Fri, Jan 3, 2014
|