TransWikia.com

Way to restore the data in the accidentally overwritten layer by its duplicate layer in QGIS?

Geographic Information Systems Asked by blackcanopus on January 12, 2021

In QGIS 3.10.12, I duplicated a GeoPackage vector layer. I made a lot of changes to the new (duplicate) layer and accidentally saved it. Now the original layer has been wiped. The undo button is disabled for the duplicate layer so I cannot undo the changes. As it turns out, this is a QGIS feature.

I don’t have a backup or shadow copy of the geo-package.

QGIS is still running. I have not closed it yet. Is there a way of restoring my data?

Such as temporary files that may have been saved somewhere (in ApplicationData or Temp folder, for example).

I tried Current Edits > Rollback For All Layers, but nothing happened.

One Answer

The original answer by @user30184:

If the .wal file still exists it is possible that edits have not been written into .gpkg file yet. Copy just the .gpkg file into another directory, rename it, open and see in which state it is.

Some tips: QGIS stores the changes in the cache files before applying them to the geo-package. If you have the same (or a similar) problem, don't close QGIS. Keep it running, don't do anything, no edits, no saves, nothing. Just make a copy of the gpkg-file immediately. Don't try making a compressed file using zip applications, because you will receive an error message akin to:

Cannot read the file because it is currently being used by another application.

Just make a copy.

Here's more information on the issue: https://issues.qgis.org/issues/19489

Answered by blackcanopus on January 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP