How to move a Worpress database to a new host?

Discussion in 'WordPress' started by Emperor, Mar 3, 2007.

  1. #1
    I’ve just bought a new blog and wanted to know how I can transfer the database to my hosting account? Has anyone here ever transferred a blog from one host to another?
     
    Emperor, Mar 3, 2007 IP
  2. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You want to move a blog from one host to another or just fill a new empty blog with a database from another one ?

    If the second case, just import you sql file via PhpMyAdmin (or whatever the MySQL control panel your host provide)
     
    Monty, Mar 3, 2007 IP
  3. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I want to move a blog I just bought to my hosting account. I don't know how to get the database from one account to the other. My hosting is from Godaddy.
     
    Emperor, Mar 3, 2007 IP
  4. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #4
    imho, the best way to proceed is to :

    export the existing database from the old host.
    make a clean and fresh install on your new host
    import the database in the new blog
     
    Monty, Mar 3, 2007 IP
  5. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks I'm going to see what I can find :D I don't know how to export the DB but am sure there will be some instructions that will help me.
     
    Emperor, Mar 3, 2007 IP
  6. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I am totally lost??? Does anyone know how to export a database using Cpanel????
     
    Emperor, Mar 3, 2007 IP
  7. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Monty, Mar 3, 2007 IP
  8. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #8
    However; you run into some import problems at GD. I did.

    Post back if you do and I will try to tell you what I did on the 8th attempt.
     
    Colbyt, Mar 3, 2007 IP
  9. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks for the link, I did manage to export the DB but now I'm having problems importing it to Godaddy since it does not have phpMyAdmin. Really don't know what to do now???
     
    Emperor, Mar 3, 2007 IP
  10. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Did you import a database to Godaddy? Can you please tell me how you managed to do that?
     
    Emperor, Mar 3, 2007 IP
  11. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Monty, Mar 3, 2007 IP
    Emperor likes this.
  12. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #12
    I did.

    I installed via their control panel. Then I used their version of phpmyadmin to import the DB. There was a problem with the charset statement. I will have to look at the dump file to tell you what to delete to make it work.

    I still have a few stray characters in some of the posts but I managed to import all the posts.
     
    Colbyt, Mar 3, 2007 IP
    Emperor likes this.
  13. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #13
    SQL query:
    
    -- phpMyAdmin SQL Dump
    -- version 2.9.0.2
    -- http://www.phpmyadmin.net
    -- 
    -- Host: localhost
    -- Generation Time: Mar 03, 2007 at 05:13 PM
    -- Server version: 4.1.21
    -- PHP Version: 4.4.2
    -- 
    -- Database: `sexyblog_newwp`
    -- 
    CREATE DATABASE `sexyblog_newwp` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    
    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci' at line 
    Code (markup):
    I'm getting the above error everytime I try uploading my DB. Can anyone help???
     
    Emperor, Mar 3, 2007 IP
  14. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
  15. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Now I can’t find my hosting account’s DNS information in order to point the domain to it. Does anyone know where I can find the hosting accounts DNS information on Gaddady?
     
    Emperor, Mar 4, 2007 IP
  16. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
  17. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Thanks for the link buy Godaddy has updated it’s hosting panel and that’s why I just can’t find anything anymore. When they had that panel it was easy but now things have changed and complicated everything.
     
    Emperor, Mar 4, 2007 IP
  18. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #18
    Okay I looked it up for you as I saved both copies of the sql dump.

    I simply opened the sql dump in notepad2 (a free download) and used the replace all function to replace "DEFAULT CHARSET=latin1"with a backspace. Note the "" were added to this post for clarity. Save your new work with a different file name in case you need to do it over.

    Do NOT open your dump file in any regular word processor.

    You may have to delete all the tables from the db if any data was written on the previous attempts.

    The actual problem is caused by the charset statement. As I recall it is an improper, but common use by some hosts. I am too lazy to look that one up this morning
     
    Colbyt, Mar 4, 2007 IP
  19. Emperor

    Emperor Guest

    Messages:
    4,821
    Likes Received:
    180
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Thanks for helping. Unfortunately I haven’t been able to fix the problem yet.

    This is the code that is giving me problems.

    CREATE DATABASE `sexyblog_newwp` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    USE `sexyblog_newwp`;
    Code (markup):
    I don't know if I can delete it all or if i must leave some parts of it. The thing is that I won't work If I only delete " latin1 "
     
    Emperor, Mar 4, 2007 IP
  20. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #20
    First off. Have you created a new DB ?
    How did you install WP?

    The way I did it when I moved a WP site is that I used the control panel autoinstall function and then I imported the existing dump file. The actual first "real" lines of the import looked like this:


    Looking at the fragment you posted I don't think you need to delete portion with the character set statement. I seem to recall that is the proper syntax. It is the charset statement that is the wrong one.

    If your dump was done properly it should start out with the identufying info at the top a bunch of lines that start with a --.

    You may want to copy and paste one section at a time using the run query mode. For example using the fragment above which was labeled as -- Table structure for table `wp_categories`. Here is the whole clip for that section.
    To insert that into the database you would simply paste that into phpmyadmin in query mode and run it. Then repeat the process for each segment. Note that when you get to the -- Dumping data for table `wp_options`section you may have to change some of the values for the
    mail server and the email address if you are not using the same domain name.
     
    Colbyt, Mar 4, 2007 IP