1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 How to successfully move from one website host to another? / An unexpected database error occurred.

Discussion in 'Installation, Upgrade, and Import Support' started by LeaderJ, Jan 10, 2012.

  1. LeaderJ

    LeaderJ Member

    Hello, I've recently moved from iPage to Hostgator. The file system on iPage was different then Hostgator. On iPage, there was only one main folder, similar to Hostgator's /public_html folder. I uploaded the xenforo files from iPage to /public_html/forums on Hostgator. I went to /library/config.php and changed the mysql settings to hopefully the new hostgator settings. Now, when I try to go to my website (www.listofservers.com/forums), I get "An unexpected database error occurred. Please try again later."

    Please help?
     
  2. ENF

    ENF Well-Known Member

    Did you restore or move your database from the previous host to the new host?

    You have to move the files and the database in order to complete a full move.
     
  3. LeaderJ

    LeaderJ Member

    How can you transfer the sql database to the new host?
     
  4. LeaderJ

    LeaderJ Member

    I'm downloading all of the files from the old host, even the ones I believe are not related to xenforo and uploading them to new host.
     
  5. ENF

    ENF Well-Known Member

    You need to download a backup of your current database from your old host and upload/restore it to the new host's database server.

    I don't know about iPage and what control panel they use, but if you can use phpMyadmin, you can export your current database from that tool and then import it into the Hostgator database server via the same tool.
     
  6. ENF

    ENF Well-Known Member

    Yeah, those are just the files for your web server. That's doesn't include the database, which is the core of the software.
     
  7. LeaderJ

    LeaderJ Member

    They have phpMyAdmin. In phpMyAdmin, what do i do from there?
     
  8. Mikey

    Mikey Well-Known Member

    You click the export tab at the top of phpMyAdmin, make sure all the tables are selected in the dropdown box, and click export. It should download a file (.sql, .sql.gz or .sql.bz, depending on your settings). You'll then need to upload this same file to your new host via the Import tab on their phpMyAdmin.

    If you need any help feel free to shoot me a PM and I'd be happy to.
     
  9. ENF

    ENF Well-Known Member

    Select the database that you would like to move and click the 'Export' button at the top navigation bar. If you have just one database, just click 'Export' and make sure that format is SQL then click "Go".

    That will download a file to your local PC. You'll use that file at the new host with the "Import" command. Assuming your database is standard format, you should be able to import it without changing the default options.
     
  10. LeaderJ

    LeaderJ Member

    About to import now. Will I have to change the 'host' on the config.php file or will it automatically change or not matter?
     
  11. Mikey

    Mikey Well-Known Member

    localhost in config.php should be fine. As far as I know hostgator don't have any special MySQL servers, but if they do you'll need to shoot them a support ticket or look in their knowledgbase.
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Mikey likes this.
  13. LeaderJ

    LeaderJ Member

    I tried uploading the sql file to my new host and got the following error:

    PHP:
    Error
     
    SQL query
    :
     
    -- 
    phpMyAdmin SQL Dump
    -- version 2.8.0.1
    -- http://www.phpmyadmin.net
    --
    -- 
    Hostcustsql-ipg02.eigbox.net
    -- Generation TimeJan 102012 at 12:49 AM
    -- Server version5.0.91
    -- PHP Version4.4.9
    --
    -- 
    Database: `xen_foro1`
    --
    -- --------------------------------------------------------
    --
    -- 
    Table structure for table `dark_azucloud_terms`
    --
    CREATE TABLE `dark_azucloud_terms` (
    `
    idint10 unsigned NOT NULL AUTO_INCREMENT ,
    `
    valuevarchar255 NOT NULL ,
    `
    blocktinyintunsigned NOT NULL ,
    PRIMARY KEY ( `id` ) ,
    UNIQUE KEY `value` ( `value` ) ,
    KEY `block` ( `block` )
    ENGINE MYISAM AUTO_INCREMENT =DEFAULT CHARSET utf8 AUTO_INCREMENT =7;
     
    MySQL saidDocumentation
    #1046 - No database selected 
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You need to select a database in the left column.
     
  15. LeaderJ

    LeaderJ Member

    Hey bro, I'm desperate right now. It's getting late and I don't like my site being down. My database name is "xen_foro1" and i click that, on the left. Then I click export > select all > SQL > then I check structure and data and check everything inside (im not sure what to do here) > hit save as file > and go. Then i go to godaddy phpmyadmin and upload and I get the same error.
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The error indicates that you didn't select a database to restore the backup to. You need to select a database in the left column, then go to Import.
     
  17. LeaderJ

    LeaderJ Member

    I did that. I still get the error. I updated the /library/config.php too
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It still says "No database selected"? That means exactly what it says. In phpmyadmin you can select a database from the left column.

    You can also use Godaddy's restore feature:

    http://help.godaddy.com/article/5648#restore
     
  19. LeaderJ

    LeaderJ Member

    Hey, I finally got it! Thanks so much for your help!
     

Share This Page