Kovah / LinkAce

LinkAce is a self-hosted archive to collect links of your favorite websites.
https://www.linkace.org
GNU General Public License v3.0
2.53k stars 159 forks source link

Broken Update Process, Export Failure #719

Closed bryanhunwardsen closed 9 months ago

bryanhunwardsen commented 10 months ago

Bug Description

The current upgrade process/documentation/code has resulted in a broken installation and loss of data. 1.11.1-simple ubsing "Simple Installation" via provided docker-compose into Synology Docker installed and ran w/o issue.

Prior to upgrade performed recommended back-up via Export functionality., encountering first issue of Data Loss. The export does/did not include Lists in the exported metadata- and now needs to be recreated(!)

I ran the manual upgrade steps as listed. All the steps executed as expected** After completing the commands I was presented with what appeared to be a fresh install requiring full first run set-up, however, during the DB portion it indicated that the existing DB entries would be reset. In retrospect, the installation was already borked, or I should have stopped by the forum and asked questions. I considered that it may only referring to wiping as a necessary part of the upgrade, but turns out it wiped EVERYTHING. Not sure what/how this happened. All steps were executed as described in the guide with no warnings or failures.

Lastly, even though all the data was dropped I appeared to have a fresh install of 1.12.2: image

But once I logged in....I find this: image

I wish I had more/better info feedback to provide. At a minimum Id like to know why a fresh install of 112.2 is still showing 1.11.1 as well to know if there is a workaround/ directdb export to retain list metadata if a feature enhancement has not already been written for this.

How to reproduce

Install via docker-compose export w/ export function upgrade following provided steps

Expected behavior

All associated metadata including list associations is included in export Upgrade does not request to overwrite existing data and in doing so wipe the db After upgsaded it shows as upgraded

Logs

No response

Screenshots

No response

LinkAce version

v1.11.1 => v1.12.2

Setup Method

Docker

Operating System

other (please specify in description)

Client details

Chrome latest

Kovah commented 10 months ago

Hi, sorry to hear that the update went wrong. I heard multiple reports of Docker deleting the database content although it is not supposed to remove any volume data during the upgrade process. Just to clarify some things: you are using the simple installation, yet there is an nginx container. This is not supposed to be like that. Does your docker-compose.yml file contain something like the following configuration?

services:
  app:
    volumes:
      - linkace_app:/app

volumes:
  linkace_app:

This might be the root cause for the broken upgrade.

Aside the issues, LinkAce has a backup feature that can be used before upgrading and they are enabled by default since version 1.10. Did you disable it? Also, the export feature is not intended to be used as a backup and it's clearly stated in the documentation.

bryanhunwardsen commented 9 months ago

Unfortunately I was unaware of the backup, and nuked my container that would have had the backups. Its hard to tell for sure as things got real sloppy after the initial upgrade went sideways.

I think(!??) this was my original from v1.11.1 install was - hard tto be certain: `version: "3"

services:

--- MariaDB

db: image: mariadb:10.7 restart: unless-stopped command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment:

volumes: linkace_app: linkace_logs: db: driver: local `

Im my backups folder I have: image

IIRC I copied the env compose there in case it got wiped, I dont recall where the mariadc tar came from but it dated the same day as the other files, the mdb folder is empty. I opened the db tar and some of the internal dates are back from april. it was likely some attempt to export a manual backup but I have no clue at this point what to even do with it.

the docker compse I have currently is: `version: "3"

services:

--- MariaDB

db: image: mariadb:10.7 restart: unless-stopped command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment:

volumes: linkace_app: linkace_logs: db: driver: local `

I dont know what to do from here, app shows 1.13.0 is available, but still running 1.11.1(???)

bryanhunwardsen commented 9 months ago

I was able to recover all the dropped links(browser history, re- adding previous entries back into link-ace), minus the list associations. I got excited to see that export to csv contains List in the metadata. I manually re-added the lost list associations in the csv only to find csv cannot be used as an import source. There still seems to be a large gap in backup and disaster recovery here. Im willing to export my data, nuke the install to correct it with a clean install of the current version, is there any way I can do this while maintaining list associations?

Kovah commented 9 months ago

The only way to keep viable backups of LinkAce is to use the application backups feature, which I linked above. It includes a full database backup.

I know the current process is not the best, but it's something and helps in case of a desaster.

bryanhunwardsen commented 9 months ago

@Kovah thanks for the support, Please close this as I had way to sloppy and undocumented process to provide you with actionable telemetry.

I was able to install 1.13.0 adv and 1.13.0 simple... (!) The adv install still demonstrates the versioning issue shown in the 2nd screenshot of my OP I dont know if/how it could be fetching the 1.11.1 image incorrectly from adv latest or if there is some downstream issue causing versioning issue seen in the screenshot. -It does not happen w/ 1.13.0 simple.

Kovah commented 9 months ago

Thanks for taking the time to go through this. Be sure it's not taken for granted. The issue with the versioning is exactly why the "advanced" images i going to be deprecated with the next big release. If introduces more issues than it solves.