1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Moving a wordpress site to another host

Discussion in 'Site & Server Administration' started by Eagle Design, Apr 24, 2015.

  1. #1
    I have a wordpress site with a theme (www_CompanySite_com) and for some reason the theme got corrupted and it wasn't showing the logo.

    So, I created a sub-directory in my server (www_MySite_com/wp) and recreated the company site.

    Now I need to move the new working good site from my host to the company site (From: MySite_com/wp to CompanySite_com)

    But I have a fill questions:

    1- Since I have a lot things in my own server, do I still backup the MySQL Databases and move to the company site?
    2- I will upload the good site using FTP, and I read somewere that I should zip the files. should I zip all the wordpress files together or each directory separately? like: "wp-includes" "wp-content" "wp-admin"
    3- On the site (www_CompanySite_com) should I delet all the wordpress files before uploanding the new ones or just the "wp-content" ?

    Thank you for any help in this matter.
     
    Eagle Design, Apr 24, 2015 IP
  2. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #2
    That probably should have been a simple fix.

    You only need to backup the Wordpress database. If you have other tables in the Wordpress database, do not backup those. Just select the tables using your Wordpress installation's table prefix, which is probably "wp_". So tables like wp_posts, other tables starting with "wp_", etc., need to be exported and uploaded to your new server.


    You want to upload your entire Wordpress installation to your new server, or at the very least your theme and wp-config file. That means everything in your Wordpress installation's directory. It will be faster for you to archive everything on your old server (in a .zip or .gz file for example) and upload that to your new server in one large file and decompress/unzip it. It will take far less time to upload one large file to your new server than to FTP thousands of small files with a lot less chance for error.


    You can just upload your themes folder (wp-content) and wp-config.php into a fresh installation of Wordpress. I have found it easier to just upload an entire Wordpress installation to the new server.

    Wordpress is files and a text database SQL file. Copy the files to the new server, import the SQL into your new server's database, make sure your wp-config database entries are correct (username, password, etc.) and that should be about it except for one thing:

    Since your existing installation is in a /wp folder and it seems you want to put it in a root folder of a different domain name, you will have to change the WordPress address (URL) and Blog address (URL) values in the admin panel Settings -> General area (I think that is where they are). Until then, your newly uploaded site may not function properly, so you can temporarily specify these values in your wp-config.php file as suggested here:

    https://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29
    https://codex.wordpress.org/Editing_wp-config.php#Blog_address_.28URL.29


    Other than that, it should be a fairly simple process.
     
    billzo, Apr 24, 2015 IP
  3. Eagle Design

    Eagle Design Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    It did look simple, but I have got all kinds of errors... I've been trying for hours now and no luck.

    This is what I did...

    I backup the entire wordpress files, zipped and uploaded to the new server. Created a new sql database and uncompressed the new wordpress.
    But when I tried to import the saved sql database from the old server to the new one it gave me all kinds of errors...
     
    Eagle Design, Apr 24, 2015 IP
  4. Eagle Design

    Eagle Design Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    I've just deleted the entire wordpress and database on the new host.
    I just installed the wordpress again and created a new database, will try to replace just the "wp-content" to see if works now.
     
    Eagle Design, Apr 24, 2015 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    Since you're not saying anything about the errors you got, there's nothing we can do to help. Information is key. Usually SQL-errors are due to chosing the wrong options when exporting, some difference in the hosts versions, or simply just that there is a lack of drop/empty/whatever when creating things
     
    PoPSiCLe, Apr 24, 2015 IP
  6. Eagle Design

    Eagle Design Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
     
    Eagle Design, Apr 24, 2015 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    Yeah? And? That means you have content in the table already - hence, "duplicate primary key" - this is child's stuff. A primary key is unique - it cannot have the same value as an existing key - hence, when you try to add something to a table with content in it already, you'll probably experience problems. Empty the original table first, if you want to only input the backup - if you don't want to delete the existing content, but just add content, you need to alter your import script.
     
    PoPSiCLe, Apr 24, 2015 IP
  8. Doctor Tech

    Doctor Tech Member

    Messages:
    60
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #8
    If you are using cPanel, you can generate a full site backup and restore it to your target destination.

    This will include restoring the database, and uploading the entire public_html directory :)
     
    Doctor Tech, May 5, 2015 IP