DB Snapshot 15 characters

There really isn’t an easy way to take a snapshot of the blockchain db is there? Shut chia down, Copy DB, Bring Chia back up.

Just wondering, Would be nice to automate the process of making a personal backup.

What I do is shut down Chia and copy the .chia & .keys folder to a USB harddisk for CYA. Then you have a copy of it all, and really take up that much space.

Some time ago, I tried supposedly live sqlite backup. It didn’t work. It is live, as long as there are no db writes, as soon as db is touched, it starts from scratch, basically making it worthless. So, killing chia and copying db is potentially the safest solution.

I might look into building a bash script to automate it. Maybe do it once a week just to save some time if the unthinkable happens.

By the way, check out this thread:

It looks like it that service is still running. Although, there is rather no update about making it more legit (as it was suggested there). It would be really nice if it could get some kind of blessing, though.

Yes, That site is exactly why I am looking to make backups. They now charge for the Chia Database. Fork’s still are free. You’re also limited to how much you can download… So… Local copy really would be ideal if you have a location to put it.

I just clicked on “DOWNLOAD 4…” and it started downloading. It didn’t ask me for any payments. Does it ask for it when you need to unzip it?

As far as free space, at least for some time, every drive has some space free that can easily accommodate db. Yeah, it slows down the process a bit, for sure.

Need this to become more legit like you said. Right now the safest way is to copy my own DB to a backup disk.

1 Like

I used the vacuum technique to back up a live database.
How to backup the Chia blockchain database [SpaceFarmers.io Wiki]

I had meant to reply sooner but the machine I was restoring on has some issues unrelated to Chia and predating Chia by about 2-3 years. (Probably why I retired it a couple years ago).

When the NUC crashed I had to re-restore my backup, but it is slowly making progress. I will probably try it on my NUC10 next since it’s a bit better (6c12t instead of 2c4t for starters).

1 Like

I have to say that I don’t know much about dbs. However, I have few concerns about that vacuum backup.

I just did it, and it finished in 10 minutes (on live Chia). Chia was all the time in sync, but block processing dropped down to one per minute or so. No clue whether this is of any concern or not. The NVMe that db is sitting on was almost choked all the time.

A potential problem for me is that the resulting db size went down from ~35GB to ~30GB. Looking up what that vacuum statement does, it says that it:

"The VACUUM command rebuilds the database file, repacking it into a minimal amount of disk space."

It further says that:

"all deleted content is purged from the backup"

Kind of makes sense to me, but if things can be deleted from that db, the question is why those things are still there.

What it implies is that when you restore db from such backup, you may be providing different data to other peers. I don’t know how all that is validated, whether those peers will just barf at your data, or rather proceed with it, and be partially cleaned up.

As far as performance. It took me about 10 mins, regardless whether Chia was running or not saturating that drive to about 70% or so (as reading / writing was in small chunks). On the other hand, stopping / starting Chia takes about a minute, and manually copying that db is another minute. Of course, during those two minutes Chia is dead.

Although, whatever that vacuum does, it may be fine to backup the wallet db, as that is just one wallet specific.

Could anyone that knows more about dbs and blockchain chime in?

For anyone stumbling across this thread in the future, it may be helpful to know that Elysium Pool has released a Chia blockchain bootstrap download service, which allows farmers and Chia users to download a snapshot of the Chia blockchain and get their full node up and running quickly and efficiently!

1 Like

Is there any chance you may add other forks?

1 Like

There is a low chance we’ll be adding additional forks at this time as our pool does not support them. That said, we are entirely open to the possibility in the near future if there is a substantial interest in the community!