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

Duplicating forum on Localhost

Discussion in 'Installation, Upgrade, and Import Support' started by matthewalan, Jun 29, 2011.

  1. matthewalan

    matthewalan Active Member

    I'm trying to duplicate my XF forum on my localhost. I've downloaded the SQL file and I'm trying to import it into my localhost installation. Although it's saying it's too big when I try to upload the SQL file it self and then when I try to add the ZIPPED file it's not working.

    It gets to the table "data_registry" before it gives me this error?

    SQL query:
    INSERT INTO `xf_data_registry` (`data_key`, `data_value`) VALUES ('styles', 0x613a333a7b693a313b613a383a7b733a383a227374796c655f6964223b693a313b733a393a22706172656e745f6964223b693a303b733a31313a22706172656e745f6c697374223b733a333a22312c30223b733a353a227469746c65223b733a31333a2244656661756c74205374796c65223b733a31313a226465736372697074696f6e223b733a303a22223b733a31303a2270726f70657274696573223b733a36363934323a22613a3330303a7b733a32333a226d65737361676553686f774d657373616765436f756e74223b733a313a2230223b733a393a22706167655769647468223b613a353a7b733a31333a226d617267696e2d626f74746f6d223b733a313a2230223b733a31313a226d617267696e2d6c656674223b733a343a2233357078223b733a31323a226d617267696e2d7269676874223b733a343a2233357078223b733a31303a226d617267696e2d746f70223b733a313a2230223b733a363a226d617267696e223b733a31353a226d617267696e3a203020333570783b223b7d733a31373a226d65737361676553686f7747656e646572223b733a313a2230223b733a363a22686561646572223b613a323a7b733a31363a226261636b67726f756e642d636f6c6f7[...]
    MySQL said:
    #2006 - MySQL server has gone away 
    I haven't seen an easier way to copy over an installation. Any ideas?? Am I doing this wrong or something?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Which application are you using for your localhost?

    You may need to adjust the settings.
    For example with XAMPP I had to edit php.ini to increase some of the values.
  3. borbole

    borbole Well-Known Member

    Two most common reasons (and fixes) for the MySQL server has gone away (error 2006) are:

    Server timed out and closed the connection. How to fix: check that wait_timeout variable in your mysqld’s my.cnf configuration file is large enough. On Debian: sudo nano /etc/mysql/my.cnf, set wait_timeout = 600 seconds (you can tweak/decrease this value when error 2006 is gone), then sudo /etc/init.d/mysql restart. I didn’t check, but the default value for wait_timeout might be around 28800 seconds (8 hours).

    Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. You can increase the maximal packet size limit by increasing the value of max_allowed_packet in my.cnf file. On Debian: sudo nano /etc/mysql/my.cnf, set max_allowed_packet = 64M (you can tweak/decrease this value when error 2006 is gone), then sudo /etc/init.d/mysql restart.

    If you are trying to restore the backup through phpmyadmin, then that happens due to file size limits and try the fixes mentioned above.

    Or you can try to restore the db thrugh some other tools like bigdump.php and/or mysqldumper. Both handle large files with ease.

    Or if you will still have the problem, then try to split the db sql backup file in smaller chunks and restore them one at a time.

Share This Page