transferring to a new host

Vaska A / 2009-04-17 19:00:43   

Nope, it's not enough. You need to export your database (using PHPMyAdmin) and then import it into the database on your new host. Then, you will need to update the /ndxz-studio/config/config.php file with the new database connection info.

Vaska A / 2009-04-17 19:16:34   

This is roughly what it should look like when you export...be sure you 'select all' and export the file by giving it a name.

Vaska A / 2009-04-17 19:22:41   

Ah yes...that happens. You just need to edit out some lines at the beginning of the file to get around that. Unless, the new host has an old version of mysql...then it's not worth trying...

Vaska A / 2009-04-17 19:35:12   

Woops...I should have mentioned that...but make a backup of that one as well first...then delete them and try to import...

Vaska A / 2009-04-17 20:06:04   

Email this to us or it will get lost...

participants [at] indexhibit [dot] org

oscarito / 2009-10-09 08:21:33   

Hi :)

I'm having error #1064 too when importing my Indexhibit DB (exported exactly as Vaska said above) in a new server. Vaska said: You just need to edit out some lines at the beginning of the file to get around that. .

My sql file starts...:

  1. -- phpMyAdmin SQL Dump
  2. -- version 2.6.0-pl2
  3. -- http://www.phpmyadmin.net
  4. -- 
  5. -- Servidor: 212.139...
  6. -- Tiempo de generaci√≥n: 09-10-2009 a las 10:12:36
  7. -- Versi√≥n del servidor: 4.1.22
  8. -- Versi√≥n de PHP: 4.3.10
  9. -- 
  10. -- Base de datos: `number`
  11. -- 

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ndxz_media`
--

CREATE TABLE IF NOT EXISTS `ndxz_media` (
`media_id` int(11) NOT NULL auto_increment,
`media_ref_id` smallint(6) NOT NULL default '0', (...)

And I receive this error:

  1. #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 '`id` int(11) NOT NULL auto_increment,
  2.   `object` varchar(100) NO 
  3. Coul you tell me, please, how could I edit that first lines to make them work? If it is simple :)
oscarito / 2009-10-09 08:24:36   

Emmm... line 3 of the code above is not code, is my ask for help: Could you tell me, please, how could I edit that first lines to make them work? If it is simple

  1. Thank you :)

Vaska A / 2009-10-09 10:44:30   

Hola oscarito...

I can't tell from your post which is "line 3" cauing the problem...nor I can tell my this sample of code. I think the line causing the problem was not posted...just a guess though.

oscarito / 2009-10-09 11:29:16   

Sorry if I didn't explain (or understand) well, my english is... not very good.

- My problem: #1064 error importing DB, same as ilferroud.
- Solution: you suggested him to edit out some lines at the beginning of the [sql] file.
- First lines of my sql file:

  1. -- phpMyAdmin SQL Dump
  2. -- version 2.6.0-pl2
  3. -- http://www.phpmyadmin.net
  4. -- 
  5. -- Servidor: 212...
  6. -- Tiempo de generaci√≥n: 09-10-2009 a las 10:12:36
  7. -- Versi√≥n del servidor: 4.1.22
  8. -- Versi√≥n de PHP: 4.3.10
  9. -- 
  10. -- Base de datos: `---`
  11. -- 
  12. -- --------------------------------------------------------
  13. -- 
  14. -- Estructura de tabla para la tabla `ndxz_media`
  15. -- 
  16. CREATE TABLE IF NOT EXISTS `ndxz_media` (
  17.   `media_id` int(11) NOT NULL auto_increment,
  18.   `media_ref_id` smallint(6) NOT NULL default '0',
  19.   `media_obj_type` varchar(15) NOT NULL default '',
  20.   `media_mime` varchar(15) NOT NULL default '',
  21.   `media_tags` varchar(255) NOT NULL default '0',
  22.   `media_file` varchar(255) NOT NULL default '',
  23.   `media_title` varchar(255) NOT NULL default '',
  24.   `media_caption` tinytext NOT NULL,
  25.   `media_x` varchar(5) NOT NULL default '',
  26.   `media_y` varchar(5) NOT NULL default '',
  27.   `media_kb` mediumint(9) NOT NULL default '0',
  28.   `media_udate` datetime NOT NULL default '0000-00-00 00:00:00',
  29.   `media_uploaded` datetime NOT NULL default '0000-00-00 00:00:00',
  30.   `media_order` smallint(3) NOT NULL default '999',
  31.   `media_hide` tinyint(1) NOT NULL default '0',
  32.   PRIMARY KEY  (`media_id`)
  33. ) ENGINE=MyISAM AUTO_INCREMENT=353 DEFAULT CHARSET=latin1 AUTO_INCREMENT=353 ; 

Maybe can you see the problem in this lines...? Thanks again!

Vaska A / 2009-10-09 11:44:35   

I would edit out this part:

  1. -- phpMyAdmin SQL Dump
  2. -- version 2.6.0-pl2
  3. -- http://www.phpmyadmin.net
  4. -- 
  5. -- Servidor: 212...
  6. -- Tiempo de generaci√≥n: 09-10-2009 a las 10:12:36
  7. -- Versi√≥n del servidor: 4.1.22
  8. -- Versi√≥n de PHP: 4.3.10
  9. -- 
  10. -- Base de datos: `---`
  11. -- 
  12. -- --------------------------------------------------------
  13. -- 
  14. -- Estructura de tabla para la tabla `ndxz_media`
  15. -- 

But, I don't think this is the problem. Try it first though...

I believe the problem has to do with incompatible MySQL versions. Yeah, it's a bit frustrating...

Get back to me if the first suggestion doesn't work...then we'll go to the next level. Don't worry though, in the end we'll be able to make this work I'm quite sure.

oscarito / 2009-10-09 12:10:20   

Good news: It works. Not so good: It works only partially. I deleted all lines starting with "--" 
and the DB was imported OK. Now I can see the home page, but non of the left links works: 

"The requested URL /left/link/ was not found on this server."  :(

?????????????

:-)

oscarito / 2009-10-09 19:39:45   

Now it works 100%

Why the links didn't work in my web after the transfer? Because I forgot to transfer .htaccess file (it was hidden) from one server to other.

Thank you very much for your help, Vaska.

:-)

Vaska A / 2009-10-09 23:06:59   

Ah great...good catch. I certainly didn't think of that one.

Sorry, but I've been out all afternoon.

;)

dofori / 2010-01-27 05:38:14   
  1. Hi - I've followed the instructions above, but I keep getting errors when I try and import my database file on the new server:
  2. Error
  3. SQL query:

CREATE TABLE IF NOT EXISTS `iptocountry` (

`ip_from` DOUBLE NOT NULL DEFAULT '0',
`ip_to` DOUBLE NOT NULL DEFAULT '0',
`country_code2` CHAR( 2 ) NOT NULL ,
`country_code3` CHAR( 3 ) NOT NULL ,
`country_name` VARCHAR( 50 ) NOT NULL ,
KEY `ip_from_to_idx` ( `ip_from` , `ip_to` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1;

MySQL said:

#1046 - No database selected

What lines of code am I supposed to delete to make this work?

This thread has been closed, thank you.