Score:0

Bareos: Bscan doesn't recover database entries (Tapes from MySQL new server Postgres Database)

us flag

I had an ubuntu server 18.04 running with bareos and mysql database. Monthly I saved data on tapedrive and everything was working fine.

Unfortunately I had a servercrash without a backup of the dump of the database (I know.)

Now I set up an Ubuntu 20.04 with postgres database, since bareos is not supporting mysql anymore.

My idea was to Bscan my tapes to recover Jobs and to access my data on the tapes.

During the bscan I get: bscan: stored/bscan.cc:789-0 Could not find Job for SessId=57 SessTime=1611327800 record.

I was using following command: bscan -V "tape1"|"tape2" -B postgres -u postgres -p "password" -v -s -S -m /dev/st0

The command didn't show me an error, but I'm not able to restore the data after the BSCAN.

Does bareos have a problem with the data on the tapes is from an Mysql server and cannot recover into the postgres database?

On my old server on mysql I was able to recover the whole database from tape when I tested that.

matterhorner avatar
us flag
with the bls tool I am able to see all Jobinfo, blocksize etc on the tape
Matthew Ife avatar
jo flag
One of the jobs that bareos typically does (by default) is a catalog backup. Do you not have a job for that previous? That would mean you could avoid most of the bscan entirely and just use bextract on the volume that contains that catalog to restore it / migrate it.
matterhorner avatar
us flag
No this is commented for some reason..
matterhorner avatar
us flag
I may have to add, a lot of tapes are from the archive, which i would have to bscan as well. These tapes were never part of the database. These were from an old bacula server.
Score:0
cn flag

Unfortunately I had a servercrash without a backup of the dump of the database (I know.)

A Painful Truth:
Any Data that you don't have [at least] two copies of is Data you don't care about losing.
That is what's happened here.

... data on the tapes is from an Mysql server and cannot recover into the postgres database?

The data files used by MySQL are nothing like the ones used by PostgreSQL.
To all intents and purposes, they contain completely different "languages" and are only "translatable" through "portable" format, like SQL.
There is no way that you can just put data files from one DBMS "into" another one and expect it to work.

Now, a [mysql]dump of the MySQL database would probably be plain, SQL text.
You might stand a chance of modifying that SQL to work with PostgreSQL - yes, SQL dialects are different, too!) and import that but, as you say, you don't have such a Backup.

You're only real chance here is to recover the data into a MySQL instance and then start worrying about how to migrate it to Postgres.
Given that Bareos used to support MySQL and now don't, it would be reasonable to expect them / its suppliers to provide its customers with tools/methods to migrate away from MySQL.
Oh wait, perhaps they already have.

matterhorner avatar
us flag
@Pill W. Thank you for your sudden answer. I know that bareos delivers a script to transfer the data from one to another database. So one way would be to install 18.04, then mysql, bareos, Bscan the tapes, install postgres and migrate the data with the script. This would take longer as if I would be able to bscan into the postgres databse (bscan includes an postgres driver parameter) I hoped for a solution where I wouldn't have to set up the server again. Now I know, that the format of the data on the tapes is not in relation of the database. So Bscan should work, but it doesn't.
Phill  W. avatar
cn flag
(I know nothing of Bareos or BScan, but) If the image on tape was of the MySQL database, then it will contain "stuff" in a format that ONLY [a specific version of] MySQL understands. PostgreSQL WILL NOT understand this "stuff". Restoring into MySQL and /then/ migrating to PostgreSQL is your /only/ practical option, no matter how long that might take.
matterhorner avatar
us flag
I fully understand what you are saying, but bscan should look over these issues. My concern is that I am using bscan wrong my database is set up wrong (checked this though) or something related to bootstrap files. Bscan looks into the volume, collects data and writes into the given database I think I would need an bareos/bscan expert for this..
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.