sundar_ima
sundar_ima

Reputation: 3910

How to move the WordPress webpage to other hosting servers?

Crrently I am trying to moving my wordpress website to new paid hosting service godaddy. It is a wordpress managed hosting. I have gone throgh a lot on internet on moving wordpress from one host to other host. The suggested duplicator plugin was not working for me. Finally, I tried the follwing:-

Assume that my old website name is

www.old-site.org

My new (temperory) address is

www.new-site.org

I downloaded the entire website from www.old-site.org

Downloaded database backup from wordpress. Then edited the old wp-config.php replaced the database name, username and password with the new site's database details. Finally used filezilla to move the old site files to www.new-site.org/new location. After all done, typed www.new-site.org/new/wp-login.php in firefox. A login window appeared and asked for the password. It looks like all done. However, after login the site addreas goes to www.old-site.org/wp-admin/. What is the mistake I have done and how do I overcome this issue? Do I have to replace URL in any file?

Edit:-

Ok. I did the following now. Downloaded the old *.sql database. Used http://pixelentity.com/wordpress-search-replace-domain/ lik for changing old url with new one. Then I gone to godaddy phpAdmin --> import database and imported the modified Sql file. But the result is same. After login the site is going back to old url.

Upvotes: 1

Views: 325

Answers (8)

André Ekeberg
André Ekeberg

Reputation: 367

For those of you missing the old tool by Pixelentity (that unfortunately has been shut down since) linked in the original post, I wanted to let you know there is an exact clone of that tool available at wordpress-search-replace.io 🍺

Upvotes: 0

Yogesh Popat
Yogesh Popat

Reputation: 82

  1. Place all the files from public_html folder of old server to the new public_html folder.
  2. Take the database backup from old server from php myadmin, go to import in it and import sql file.
  3. open the sql database file in editor such as notepad++ or anything and find siteurl where you will find old website address as something like http://www.oldsite.com you have to replace all such old url in to your new url so use ctrl+f and replace www.oldsite.com to www.newsite.com and save the sql file
  4. on your new server create new database and take note of its username, password and database name
  5. on your new server open phpmyadmin and export the sql file to the new database so created.
  6. open wp-config.php that will be in your public_html(root) folder in new server and replace database name, database user name and user name password (that you have noted in step 4). if followed correctly it should work.

Alternatively for database URL replacement you can use wp migrate db plugin that takes care of serialized arrays..

Also for complete automatic migration you can use all-in-one wp migration plugin which is also good

Upvotes: 2

Jishad
Jishad

Reputation: 2965

Please run these SQL queries in your database:

UPDATE wp_options 
SET option_value = replace(option_value, 'www.old-site.org', 'www.new-site.org') 
WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts   
SET guid = replace(guid, 'www.old-site.org', 'www.new-site.org');

UPDATE wp_posts 
SET post_content = replace(post_content, 'www.old-site.org', 'www.new-site.org');

UPDATE wp_postmeta 
SET meta_value = REPLACE (meta_value, 'www.old-site.org','www.new-site.org');

Upvotes: 1

Aerendir
Aerendir

Reputation: 6389

As pointed out by the previous answers, the unique thing you have to do is to change the references to old url with references to the new ones.

To do this, you ha ve to change the configuration settings in your wp-config.php file as pointed out by Chilion:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Once you have done this, you have to change references also for slugs. The URL of slugs are more complex to change, as they cannot be simply edited: they are serialized, so you need a dedicated script.

Here there are all the information you need: http://codex.wordpress.org/Moving_WordPress

Duplicator is really a great plugin to automate the migration: what didn't exactly work for you? Which is the problem?

Upvotes: 0

Chilion
Chilion

Reputation: 4500

You must edit your wpconfig.php to contain the new "base url" and besides that, edit your database to have the right URL.

Otherwise it will always redirect you to your old site.

WPconfig:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Database:

Look for the table wp_options. Find under option_name the "siteurl" and change the option_value to contain the new URL.

Might also want to look @ http://codex.wordpress.org/Changing_The_Site_URL

Upvotes: 1

Jenis Patel
Jenis Patel

Reputation: 1615

Please make sure in your 'wp_options' table the values for :

'siteurl' and 'home' should be => www.new-site.org

Upvotes: 1

Bruno H. Paes
Bruno H. Paes

Reputation: 98

You need change all places where your old URL is recorded in database.

For that you can use this plugin: https://wordpress.org/plugins/search-and-replace/

Using this 'Search and Replace' look for 'www.old-site.org' and replace to 'www.new-site.org/new'.

In your wp-config is important find all old URL and replace to the new too.

I hope it helps!

Upvotes: 0

Steve
Steve

Reputation: 20469

The database will contain references to the old url, to fix you can edit the .sql backup before reimporting it:

Delete the database on your new host.

Open the sql backup file from your old host in notepad or similar texteditor

Do a find and replace for www.old-site.org to www.new-site.org/new, save, and import into new hosting.

Upvotes: 0

Related Questions