Backup an entire database
Backup an entire database
Hi,
what is the simple way to back an entire database ?
The structure of the database may vary, and the name/number of tables also.
So table name or parameters should be retrieved automatically.
Same question for restoring the database.
Regards
Armindo
what is the simple way to back an entire database ?
The structure of the database may vary, and the name/number of tables also.
So table name or parameters should be retrieved automatically.
Same question for restoring the database.
Regards
Armindo
-
AndreyZ
Re: Backup an entire database
Hello,
To create a full database backup, we suggest you to use the TMyDump component. TMyDump creates a SQL script that contains the structure of the tables and theirs data. Here is a code example of the TMyDump usage:
backup:
restore:
For more information about TMyDump, please refer to the MyDAC documentation.
To create a full database backup, we suggest you to use the TMyDump component. TMyDump creates a SQL script that contains the structure of the tables and theirs data. Here is a code example of the TMyDump usage:
backup:
Code: Select all
MyDump1.BackupToFile('C:\backup.sql');Code: Select all
MyDump1.RestoreFromFile('C:\backup.sql');-
AndreyZ
Re: Backup an entire database
If any other questions come up, please do not hesitate to contact us.
Re: Backup an entire database
I can backup and restore my database, except that I have a big problem, all accents are replaced by stranger char.
So the datas of the databse is corrupted.
my database is ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
I'm wondering if the dump file is saved as a utf8 file ?
any idea of how to solve this ?
Regards
So the datas of the databse is corrupted.
my database is ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
I'm wondering if the dump file is saved as a utf8 file ?
any idea of how to solve this ?
Regards
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Backup an entire database
Hello.
To solve the issue, you should set the TMyConnection.Options.UseUnicode property to False, and the TMyConnection.Options.Charset property - to 'utf8'. For example:
To solve the issue, you should set the TMyConnection.Options.UseUnicode property to False, and the TMyConnection.Options.Charset property - to 'utf8'. For example:
Code: Select all
MyConnection1.Options.UseUnicode := False;
MyConnection1.Options.Charset := 'utf8';
MyDump1.Connection := MyConnection1;
MyDump1.BackupToFile('C:\backup.txt');Re: Backup an entire database
Thanks it works now. 
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Backup an entire database
If any other questions come up, please contact us.
Re: Backup an entire database
Hi,
The problem is that I have to disconnect to the database for backup/restoring, then changing the TMyConnection properties because if I use the same settings I will have strange char in my DB controls this time.
Then after using backup/restore I will have to set back the older properties...
Isn't there a way to have right datas at the same time in backup/restore and in DB controls ?
Thanks
The problem is that I have to disconnect to the database for backup/restoring, then changing the TMyConnection properties because if I use the same settings I will have strange char in my DB controls this time.
Then after using backup/restore I will have to set back the older properties...
Isn't there a way to have right datas at the same time in backup/restore and in DB controls ?
Thanks
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Backup an entire database
You can perform database backup/restore via a separate connection, having created a new TMyConnection object.
Re: Backup an entire database
That's what I've finally done.
Thanks
Thanks
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Backup an entire database
If any other questions come up, please contact us.
Best regards,
Demetrion
Devart Team
Best regards,
Demetrion
Devart Team