Foren

Consistent Backup

Lawrence Brian, geändert vor 9 Jahren.

Consistent Backup

New Member Beiträge: 3 Beitrittsdatum: 29.10.14 Neueste Beiträge
I have a general question about backup.

Liferay Portal consists of files and metadata stored in a database.
If I want a consistent backup, is it necessary that both are backed up at the exact same time?
That can be quite difficult on a busy site.
Also, it would prevent us from using database point-in-time-recovery to restore to states between the backups.

Does Liferay delete or modify files on the file system during normal operation?
If not, it might be possible to use an earlier database backup with a later file system backup.

I'd be thankful for any insights or pointers!
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: Consistent Backup (Antwort)

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Docs and media store to the filesystem (by default). If you allow users to upload docs and media at all hours, this sync issue could happen. Most sites don't do that, but Liferay is an example that does - you can upload images to the forum 24x7. I think the idea is that the 'out of sync' issue will actually be rarer than what you believe, but even in cases where it may occur you're not losing something that will cause that much of a problem if a restore occurs.

Besides, if you have a mission critical system you've got a cluster with a remote database, remote shared nas, etc. Your outages in this environment would be a failed node or something, but even when it is the db or nas they are enterprise elements that have layer upon layer of recovery options (i.e. your nas is likely a RAID array and can handle some outage situations without failing outright).
Lawrence Brian, geändert vor 9 Jahren.

RE: Consistent Backup

New Member Beiträge: 3 Beitrittsdatum: 29.10.14 Neueste Beiträge
Of course there will be redundancy, but you still need a backup if you value your data.
There are many things that can cause data loss, even if you are protected from a hardware outage.
A simple example would be a DBA accidentally dropping a table.

But essentially you answered my question:
If I want a consistent backup of a Liferay system, I'd better make sure that documents and database are backed up at exactly the same time.

Thanks for the time!
thumbnail
Milen Dyankov, geändert vor 9 Jahren.

RE: Consistent Backup (Antwort)

Expert Beiträge: 310 Beitrittsdatum: 30.10.12 Neueste Beiträge
In case you haven't seen it already you may also find http://javaguru.fi/blog/-/blogs/how-to-create-a-consistent-liferay-backup useful
Lawrence Brian, geändert vor 9 Jahren.

RE: Consistent Backup

New Member Beiträge: 3 Beitrittsdatum: 29.10.14 Neueste Beiträge
That link was very helpful indeed. It shows that there is no easy road to a consistent Liferay backup.

To make up for the attention I received, I'd like to share the solution that I have come up with.
First of all, we use PostgreSQL and not MySQL because our data are valuable to us.
This is how we intend to do it:
- Perform an online file system backup of that PostgreSQL database.
- After the backup has finished, take a file system snapshot of the files and remember the exact timestamp.

For restore, we restore both the file system and the database and then recover the database to the point in time of the file system snapshot.