import and restore 500MB Magento SQL database backup file into new server - database

I've spend whole day trying to restore a 499MB .SQL magento database backup file into a new server. I have tried importing into another PC offline but im getting same error Unknown command '\9' and '\a', im trying to restore the .SQL file using the following command - mysql -u -p databasename < backup.sql
I have tried Bigdump script but no success. The database file is too large it won't even open up on my pc.
Is there any other way to restore a database backup file of this size into a new server ? Help would be greatly appreciated!
Update: Strange characters appearing on opening .SQL backup file.strange characters in .sql file
Thanks in advance

Make sure the character sets of the databases match up. eg: mysql --default-character-set=utf8 database < databasedump.sql

Related

ftrows_FTP...ndf file preventing a restore

I am trying to restore a db with a backup, but it fails each time because of a file in use. The file is ftrow_FTC{xxxxxxx}.ndf
Does anyone know what this file is and what its for? Do I need it? If not, how can I get rid of it? Thank you.
I should add, this is SQL 2012 server on a Server 2008 R2.
the ftrow_FTC{xxxxxxx}.ndf if a Full-Text Catalog file. You're probably using SQL Server Management Studio wizard to restore that database. However, you can also use a t-sql command to do the restore.
In the latter case you could tell SQL Server to restore your full text catalog file under different name/path with the RESTORE ... WITH MOVE command:
RESTORE DATABASE DBNAME from disk = N'd:\path\to\your\backup.bak'
WITH MOVE 'ftrow_FTC{xxxxxxx}.ndf' TO 'd:\path\to\new\FT_location\ftrow_FTC{xxxxxxx}.ndf'
replace the DBNAME with your real DB name and the ftrow file name with real file name.
UPDATE: you can also easily restore your DB with full text catalog under different file name using SQL Server Management Studio dialog. During restore simply locate your ftrow file record in the DB files list and assign it to different path. That way you will not get conflict with the ftrow file used by your live DB.
HTH

Lightroom database corrupted after recovery

I am trying to rebuild an Adobe Lightroom catalog file which is basically a SQLite database. In this case the file was accidently deleted and recovered using Disk Drill. When I use .dump to create an SQL file, I only get a very small file out of there original 5.5GB catalog file and it is useless. If I try to open the file in DB browser for SQLite it thinks it is encrypted and asks for a password. Any suggestions how I could fix that would be greatly appreciated.

Cannot Restore from Backup File to Sybase

We have a very old sybase server. Our database in it is acting up. We need to restore the backup database file from our backup sybase server. But when I try that, I keep getting this error message:
Msg 7205, Level 17, State 2: Line 1: Can't open a connection to site
'SYB_BACKUP'. See the error log file in the SQL Server boot
directory.
That is how I restore the database backup:
1. Use RCP to copy the dump file from the spare server to the primary server. And name the copy "frombkup_mydb.dump".
2. Drop the old database from the primary server, and re-create an empty one.
3. Then use the following command to load the database from the backup dump file:
load database mydb from "/export/home/syb11.dump/frombkup_mydb.dump"
Unfortunately I don't know where the error log file is. I am not familiar with SCO Unix and Sybase.
Does anyone know why the restore doesn't work?
Please help. Thanks.
Jay Chan
It's likely that your Backup Server is not running.
The SAP/Sybase ASE database process requires the backup server to be running for database backups or restores.
To find which database processes are running you can use the showserver command usually located in:
$SYBASE/$SYBASE_ASE/install/showserver
If the backup server is not running (likely), then in the ./install/ directory, look for the file named RUN_SYB_BACKUP
You can start the server by issuing the command (from the ./install/ directory)
startserver -f RUN_SYB_BACKUP
This should start the backup server, and allow you to restore the database.

How to restore a MySQL .dump file in remote host

i create backup from localhost MYSQL database(drupal) using PHPMyAdmin (file format *.sql). size of this backup = 20MG. i create new database in PHPMyAdmin my live(online) server. Now, when i import backup sql Files i see this error :
#2006 - MySQL server has gone away
i know this error fix with this:
edit ../sql/bin/my.ini
set max_allowed_packet to e.g. 16M
but my server support said: better way is restore mysql using:
mysql -u username -p dbname < file.sql
now, i don't know how to work with this command line for remote server?!
You need SSH access to your server to execute that command using a terminal. If support told you you should use that command, I would think you have SSH access. The SQL file would have to be on your server, so you'd need to transfer it there first (using for example scp).
But if you're not used to the command line, I would recommend first spending some time learning the basics before jumping right into it ;)

I have a 18MB MySQL table backup. How can I restore such a large SQL file?

I use a Wordpress plugin called 'Shopp'. It stores product images in the database rather than the filesystem as standard, I didn't think anything of this until now.
I have to move server, and so I made a backup, but restoring the backup is proving a horrible task. I need to restore one table called wp_shopp_assets which is 18MB.
Any advice is hugely appreciated.
Thanks,
Henry.
For large operations like this it is better to go to command line. phpMyAdmin gets tricky when lots of data is involved because there are all sorts of timeouts in PHP that can trip it up.
If you can SSH into both servers, then you can do a sequence like the following:
Log in to server1 (your current server) and dump the table to a file using "mysqldump" --- mysqldump --add-drop-table -uSQLUSER -pPASSWORD -h
SQLSERVERDOMAIN DBNAME TABLENAME > BACKUPFILE
Do a secure copy of that file from server1 to server2 using "scp" ---
scp BACKUPFILE USER#SERVER2DOMAIN:FOLDERNAME
Log out of server 1
Log into server 2 (your new server) and import that file into the new DB using "mysql" --- mysql -uSQLUSER -pPASSWORD DBNAME < BACKUPFILE
You will need to replace the UPPERCASE text with your own info. Just ask in the comments if you don't know where to find any of these.
It is worthwhile getting to know some of these command line tricks if you will be doing this sort of admin from time to time.
try HeidiSQL http://www.heidisql.com/
connect to your server and choose the database
go to menu "import > Load sql file" or simply paste the sql file into the sql tab
execute sql (F9)
HeidiSQL is an easy-to-use interface
and a "working-horse" for
web-developers using the popular
MySQL-Database. It allows you to
manage and browse your databases and
tables from an intuitive Windows®
interface.
EDIT: Just to clarify. This is a desktop application, you will connect to your database server remotely. You won't be limited to php script max runtime, or upload size limit.
use bigdupm.
create a folder on your server witch is not easy to guess like "BigDump_D09ssS" or w.e
Download the http://www.ozerov.de/bigdump.php importer file and add them to that directory after reading the instructions and filling out your config information.
FTP The .SQL File to that folder along side the bigdump script and go to your browser and navigate to that folder.
Selecting the file you uploaded will start importing the SQL is split chunks and would be a much faster method!
Or if this is an issue i reccomend the other comment about SSH And mysql -u -p -n -f method!
Even though this is an old post I would like to add that it is recommended to not use database-storage for images when you have more than like 10 product(image)s.
Instead of exporting and importing such a huge file it would be better to transfer the Shopp installation to file-storage for images before transferring.
You can use this free plug-in to help you. Always backup your files and database before performing this action.
What I do is open the file in a code editor, copy and paste into a SQL window within phpmyadmin. Sounds silly, but I swear by it via large files.

Resources