shlink: Unable to upgrade from 2.10.2 > 3.0.0

I seem to be having a similar issue when upgrading from 2.10.2 > 3.0.0

How Shlink is set-up Shlink Version: 3.0.0 PHP Version: 8.0.14 How do you serve Shlink: Self-hosted, Apache 2.4.4, Ubuntu 20.04 LTS Database engine used: SQLite

Summary Trying to upgrade from 2.10.2 to 3.0.0 and v3 is unable to migrate v2 database.

Behavior

link@seattle:~/domains/serve.link.nwadventists.com$ ll
total 1304
drwxr-x--- 12 link link    4096 Feb  7 16:14 ./
drwxr-xr-x  4 link link    4096 Feb  6 02:03 ../
-rw-r--r--  1 link link      44 Feb  6 01:49 .virtualmin-src
drwxr-x---  2 link link    4096 Aug 10 12:34 cgi-bin/
drwxrwxr-x  2 link link    4096 Feb  7 15:59 data/
drwxr-xr-x  4 link link    4096 Aug 10 12:34 etc/
drwxr-xr-x  2 link link    4096 Jul 21  2021 fcgi-bin/
drwxr-xr-x  2 link link    4096 Sep  1  2020 homes/
drwxr-x---  2 link link    4096 Sep  1  2020 logs/
-rw-rw-r--  1 link link 1253376 May 24  2021 original_database.sqlite
lrwxrwxrwx  1 link link      13 Sep  1  2020 public_html -> shlink/public/
drwxrwxr-x  8 link link    4096 Feb  7 15:38 shlink/
drwxrwxr-x  8 link link    4096 Feb  7 15:38 shlink-old-old/
drwxr-xr-x  8 link link    4096 Jan  7 12:55 shlink2.10.2_php8.0_dist/
-rwxr-xr-x  1 link link    3750 Dec 12 15:07 ssl.ca*
-rwx------  1 link link    2264 Dec 12 15:07 ssl.cert*
-rwx------  1 link link    6016 Dec 12 15:07 ssl.combined*
-rwx------  1 link link    7725 Dec 12 15:07 ssl.everything*
-rwx------  1 link link    1708 Dec 12 15:07 ssl.key*
drwxr-x---  2 link link    4096 Sep  1  2020 tmp/
link@seattle:~/domains/serve.link.nwadventists.com$ wget https://github.com/shlinkio/shlink/releases/download/v3.0.0/shlink3.0.0_php8.0_dist.zip && unzip shlink3.0.0_php8.0_dist.zip && rm shlink3.0.0_php8.0_dist.zip && mv shlink/ shlink-old/ && cp -ap shlink3.0.0_php8.0_dist/ shlink/ && cd shlink/ && vendor/bin/shlink-installer update -vvv
--2022-02-07 16:18:15--  https://github.com/shlinkio/shlink/releases/download/v3.0.0/shlink3.0.0_php8.0_dist.zip
Resolving github.com (github.com)... 140.82.113.3
Connecting to github.com (github.com)|140.82.113.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/55801807/d38f8fc6-0532-447c-9411-57fb23181c7e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220208%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220208T001815Z&X-Amz-Expires=300&X-Amz-Signature=bc10f0b7362843a3b4342a018258b15710559a41be68ae705154cd1e74495a0d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=55801807&response-content-disposition=attachment%3B%20filename%3Dshlink3.0.0_php8.0_dist.zip&response-content-type=application%2Foctet-stream [following]
--2022-02-07 16:18:15--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/55801807/d38f8fc6-0532-447c-9411-57fb23181c7e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220208%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220208T001815Z&X-Amz-Expires=300&X-Amz-Signature=bc10f0b7362843a3b4342a018258b15710559a41be68ae705154cd1e74495a0d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=55801807&response-content-disposition=attachment%3B%20filename%3Dshlink3.0.0_php8.0_dist.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22311182 (21M) [application/octet-stream]
Saving to: ‘shlink3.0.0_php8.0_dist.zip’

shlink3.0.0_php8.0_dist.zip    100%[===================================================>]  21.28M  44.6MB/s    in 0.5s    

2022-02-07 16:18:16 (44.6 MB/s) - ‘shlink3.0.0_php8.0_dist.zip’ saved [22311182/22311182]

Archive:  shlink3.0.0_php8.0_dist.zip

 Welcome to Shlink!!
 This tool will guide you through the installation process.

 Do you want to import configuration from previous installation? (You will still be asked for any new config option that did not exist in previous shlink versions) (yes/no) [yes]:
 > yes

 Previous shlink installation path from which to import config:
 > ../shlink-old/

DATABASE
========

 Database name [shlink]:
 > 

The CLI accepts the previous instance path, but then it asks to setup the database, though one already exists. Completing the CLI questions results in a broken install and database not migrated. If I tried to enter other paths, but the CLI will tell me those aren’t valid, so obviously my initial path is correct.

_Originally posted by @antwonw in https://github.com/shlinkio/shlink/issues/1357#issuecomment-1032087525_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Hmm, that is weird. It should not be asking you that.

I’ll check tomorrow again. I’m not sure what I might have missed this time.

I finally got it.

I’m super glad to hear that. I’m not sure what happened in the middle of the process, but at least everything is there now.

One last thing, why do I get this error message each time I update -vvv? I’ve gotten this in bot v2 and now here in v3.

It’s actually not an error. For some reason, the library I use to run Shlink commands from the CLI, displays that ERR prefix when running a sub-process in verbose mode, which is quite confusing. But if you check, it’s actually a successful output.

I’ll try to report it to them. Or maybe it’s me, that I’m redirecting the standard output of the sub-process to the error output of the parent process. I’ll check that as well.

I have just released Shlink 3.0.2. You should be able to update from 2.10.x directly to it and it should properly migrate the database config when using SQLite.

https://github.com/shlinkio/shlink/releases/tag/v3.0.2

I found the root cause. I’ll release a fix between tomorrow afternoon and the weekend.

Thanks! Let me know if you’d like me to test anything or provide any other reports.