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

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?
 
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.
 
How can you transfer the sql database to the new host?

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.
 
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.

Yeah, those are just the files for your web server. That's doesn't include the database, which is the core of the software.
 
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.

They have phpMyAdmin. In phpMyAdmin, what do i do from there?
 
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.
 
They have phpMyAdmin. In phpMyAdmin, what do i do from there?

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.
 
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.

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

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.
 
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
--
-- Host: custsql-ipg02.eigbox.net
-- Generation Time: Jan 10, 2012 at 12:49 AM
-- Server version: 5.0.91
-- PHP Version: 4.4.9
--
-- Database: `xen_foro1`
--
-- --------------------------------------------------------
--
-- Table structure for table `dark_azucloud_terms`
--
CREATE TABLE `dark_azucloud_terms` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`value` varchar( 255 ) NOT NULL ,
`block` tinyint( 1 ) unsigned NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE KEY `value` ( `value` ) ,
KEY `block` ( `block` )
) ENGINE = MYISAM AUTO_INCREMENT =7 DEFAULT CHARSET = utf8 AUTO_INCREMENT =7;
 
MySQL said: Documentation
#1046 - No database selected
 
You need to select a database in the left column.

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.
 
Top Bottom