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

#1
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?
 

ENF

Well-known member
#2
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.
 
#4
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.
 

ENF

Well-known member
#5
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.
 

ENF

Well-known member
#6
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.
 
#7
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?
 

Mikey

Well-known member
#8
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.
 

ENF

Well-known member
#9
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.
 
#10
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?
 

Mikey

Well-known member
#11
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.
 
#13
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
 
#15
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.
 

Jake Bunce

XenForo moderator
Staff member
#16
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.