Migrate Heavy wp-content Folder From One Host to Another Easily

dailydose
#1

Consider,

  • You want to migrate a 15GB WordPress site
  • You have 1 GB Internet data only for next few hours.

In this kind of situation, taking backup with a plugin like Updraft, and restoring the backup is not going to work. Browser hang is one of the first issues, that you may face while restoring the site.

Even manually downloading and uploading wp-content would be a plain waste of time.

Solution

Migrating heavy WordPress site with SSH is the best way to go.

For example, let’s say you have an old site at Cloudways and you want to migrate it to a new Server there, I assume that you already WordPress installed.

Below is a step-by-step process that you need to follow.

(This process assumes that before migration to new hosting, your domain is pointed to the old hosting server, in order to download wp-content.zip file via SSH at the new Server)

  1. Login to Cloudways > Server

Copy Master Credentials (IP, Username and Password)
Copy application path

  1. Access now using Putty

  2. Type cd applications/app name/public_html/ to navigate public_html directory

  3. Type zip -r wp-content.zip wp-content/ to create a zip file of whole wp-content folder

Wait till competition, this may takes few minutes to hour.


  1. Now, Login to new server via Putty

  2. Type cd srv/users/serverpilot/apps/appname/public/ to navigate public_html directory

  3. wget http://example.com/wp-content.zip to download wp-content.zip folder which we created in last step 4th.

  4. rm -rf /wp-content/ to delete existing default wp-content folder

  5. unzip wp-content.zip to unzip and bring old hosting wp-content folder which you need.

Now, wp-content part done.

  1. Go back to Cloudways > Application > launch MySql Manager > Export all tables at system

  2. Login again to public_html directory of new server

  3. Install phpMyAdmin at new server, process is written below

wget https://files.phpmyadmin.net/phpMyAdmin/4.8.4/phpMyAdmin-4.8.4-all-languages.zip && unzip phpMyAdmin-4.8.4-all-languages.zip && rm phpMyAdmin-4.8.4-all-languages.zip && mv phpMyAdmin-4.8.4-all-languages phpmyadmin
  1. Edit wp-config.php, grab MySQL username and password

  2. Point new IP to your domain

Edit host file or switch at DNS directly

  1. Login to www.example.io/phpmyadmin/, username and password you can find inside new server wp-config.php file :stuck_out_tongue_winking_eye: just type nano wp-config.php, double click on username/password and CTRL+C to copy.

  2. Export old hosting SQL database tables

  3. Now, please make sure to update table prefix at wp-config.php as per Database. Else, you will see just Famous Five minutes installation page.

Default may be

$table_prefix = 'wp_';

You may need to update like this $table_prefix = 'wp_c319a4295d_';
image

  1. Point your domain to new IP address.

  2. Add a robots.txt file, that may be missing.

That’s all. I hope this helps.

#DailyDose

Related: [Guide] Install WordPress into Subdirectory at Cloudways

Thanks & Regards,
Gulshan

12 Likes

Using Updraft plus for migration?
Website migration from shared to cloud
I have to migrate from hostgator to Digital Ocean help me
Updrafts Creates Problem while restoring the backup
Migrate WordPress from Cloudways to Vultr with ServerPilot (In 1 hour)
The most awaited tutorial is here: Learn Installing LEMP
Migrate WordPress from Cloudways to Vultr with ServerPilot (In 1 hour)
#6

Can anyone explain what is happening from the step 2 to 9. The wp content folder is directly get copied from old to new server? :confused:

0 Likes

#7

Please check now, and update me again if still I need to clarify. Thanks for pointing out.

It was intent for advanced users, who can just take it as bookmark. :smiley:

4 Likes

#8

First part is my favorite :heart_eyes:

For second part I think direct backup will be better. Actually never used phpmyadmin… It looks confusing to me.

What if be backup MySQL DB also in ssh. Then we can transfer db too, without downloading.

Export:

mysqldump -u USERNAME -p DATABASE_NAME > filename.sql

Transfer:

Wget example-com/filename.sql

Import:

mysql -u USERNAME -p DATABASE_NAME < filename.sql
3 Likes

#9

Amazing

1 Like

#10


Sir getting this error. How can we fix?
@GulshanKumar

0 Likes

#11

Hi @himanshu, it appears that page is asking for the HTTP auth. In real, I am not able to download. Try after removing HTTP Auth restriction.

2 Likes

#12

If you want to move the whole website, then I will suggests you to use this plugin.You can simply export & import your wordpress website easily in just few clicks.

2 Likes

#13

it’s content 1GB+ .

SO…

2 Likes

#14

Yes, that’s a good plugin but very limited (only 50MB).

0 Likes

#15

yes

0 Likes

#16

Then you must recharge your data-pack to get more data in one day.
Then just export & import the file.
If I don’t wrong, then youre using JIO SIM ?

1 Like

#17

yes Jio but
too Slow :cry::cry:

0 Likes

#18

I have fast Internet, let me know if I can help.

0 Likes

#19

Then you have to buy a premium plan from this plugin to get directly your Export file in google drive, then you can upload/import it directly to destination server from google drive.
I have never tried this plan. But you can cheak it from this plugin prices ?
If you find everything is ok, then you may proceed .

0 Likes

#20

this code na? whos auth http?

by removing this can above command run?

1 Like

#21

Can you share full code? A to Z.

0 Likes

#22

https://drive.google.com/open?id=1ULYPODqMm9imykuThwNQUrTFw6Z6Uk7m
@GulshanKumar See Sir

0 Likes

#23

Ok, I will check and update.

0 Likes

#24

oke Sir

0 Likes