Migrating WordPress Site To Digital Ocean Cloud Server

Migrate WordPress Site To Digital Ocean

In this article, we have shared a small guide for to migrate WordPress site to Digital Ocen droplet.

Backing Up WordPress Files From Current Hosting Provider

You need to backup and get the following data .

1. MySQL file. This you can get it from the PHPMyAdmin page of your existing hosting.
2. Complete wp-content content folder from current hosting.
3. If you added custom rules in the .htaccess file, backup and download the same.

Setting Up Digital Ocean Server

1. Launch the droplet using one click WordPress ubuntu 14.04 image.

2. Log into the server using ssh. Note down the details in the welcome message.

3. Update the server

5. In the welcome page, you can see all the default Mysql and PhP details (Default mysql root password, php.ini location etc). You can also view it using the following command.

Chane the default MySQL root password using the following command.

Setup PHPMyadmin

PHPMyadmin makes it easy to import the database and manage new users.

1. Install PHPMyadmin

2. Enable php mcrypt.

3. Open /etc/php5/apache2/php.ini file and increase the file_upload_limit and post_max_size parameter to 50MB or more depending on your SQL file size.

3. Restart apache server.

Create Database, User, And Import The Database

Create a new database and a database user using PHPMyadmin page. Make user you give all the privileges to the new user to the database you create.

You can also create database and user using MySQL CLI with the commands given below. Change the database name, user name and password accordingly.

After this, head over to PHPMyAdmin page and log in with your DB credentials.

1. Now select the created database and click the import option.

2. Upload the SQL backup file you downloaded from your current hosting provider and click import. This will import all your WordPress data.

Upload Wp-Content Folder

1. Upload the wp-content backup folder to Digital ocean droplet using SCP or a tool like FileZilla.

2. Replace the default wp-content droplet folder with your wp-content folder in /var/www/html folder.

3. Change the wp-content folder owner to www-data

3. Open wp-config.php file and change the database, database user, and password. Also, check the table prefix parameter. If your existing table prefix it is other than wp_, change it in the wp-config.php file.

Map The IP To Domain Name

1. Copy the droplet public IP from Digital ocean panel.

2. Open the DNS zone editor of your domain name from your domain name provider and update the A record to digital ocean IP.

It will take few minutes to hours for the DNS update. Once the DNS update happens, Digital Ocean droplet will start serving your website.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s