FB4 is unable to overwrite database files created by older firebird versions. It concerns gbak restore (with -rep switch) and database creation functions, even when run under sysdba account. This is probably not an error per se, but it differs from FB3 and can complicate automated database migration process.
gbak -rep -v -user sydba -password masterkey C:\TEST\TEST.GBK localhost:C:\TEST\TEST.FDB
gbak: ERROR:unsupported on-disk structure for file C:\TEST\TEST.FDB; found 11.2, support 13.0
gbak: ERROR: IProvider::attachDatabase failed when loading mapping cache
gbak: ERROR:failed to create database localhost:c:\TEST\TEST.FDB
Local (embedded) connections are not affected, only TCP ones. Strangely, when embedded overwriting is tested first, the server seems to remember that it has successfully accessed this database file, so that subsequent TCP rewrites of the same file (that I each time replace by the original old database) now succeed as well. This lasts until server is restarted.