Is it safe to copy the database file?


Generally, it is safe to copy the database file. But, be cafeful:

If you copy it when Firebird server is shut down, there shouldn't be any problem, it's just like any other file on the system. Same applies for databases with no users connected.

Copying database file while it's in use is a bad idea. As Firebird might write new transactions during the copy process, your copy will most probably get corrupt. It's always better to do backup and subsequent restore.

If backup/restore is too slow for you, or you want to use some 3rd party backup tool that only supports file-copy, you can solve the problem with Firebird's nBackup tool:

- lock the database file with nbackup
- copy the file
- unlock it

Locking the database is this way does not prevent database from functioning. All transactions are written to a separate place, and once you unlock the database, they get merged into the main file.

For more information, read nBackup manual:

http://www.firebirdsql.org/manual/nbackup-lock-unlock.html


Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.

If you are a commercial tool maker and your tool features a great way to handle the issue written about in this FAQ, please check out our advertisement page.



All contents are copyright © 2007-2017 FirebirdFAQ.org unless otherwise stated in the text.


Links   Firebird   News   FlameRobin   Home Inventory powered by FB  
Add content   Advertise   About  

Categories
 Newbies
 SQL
 Installation and setup
 Backup and restore
 Performance
 Security
 Connectivity and API
 HOWTOs
 Errors and error codes
 Miscellaneous