Streaming database backup, network transfer and recovery with conversion from FB 2.5 to FB 3.0

The task is to transfer the database from one server to another as quickly as possible, with the conversion of its ODS to 12.0.



The idea was borrowed from the article Streaming conversion of Firebird 2.5 databases to ODS12 (Firebird 3.0) format , which discusses the issue of streaming conversion on one machine, with the installation of two versions of Firebird, which is not very convenient when considering moving to another server.



What we have:



  1. Two servers, with versions FB 2.5 and FB 3.0
  2. Local network between servers
  3. DB file weighing 145gb


The general idea of ​​the transfer consists of the same pipeline that was given in the above article, you only need to make some minor adjustments:



gbak -b -g ... 25.fdb stdout | ssh -t ... user@host "sudo gbak -c stdin 30.fdb"
      
      





After restoring, it would be good to point the firebird user and check the database:



sudo chown firebird:firebird 30.fdb
gfix -v -full 30.fdb

      
      





Everything, if the database is intact, then there will be no errors, detailed information on the result of checking the database file can be viewed in /var/lib/firebird.log, if everything is fine there, then you can switch users to work with the new database.



The transfer took about 80 minutes, which seems pretty quick to me.



All Articles