Migrate nextcloud from Raspberry to Ubuntu with links

Hi all
It has been some years that I run an instance of nextcloud in a Raspberry PI4.

I’m moving my own site -wordpress- at home (apache+vhost- in the same machine I run also NC). That is OK, almost done, let’s encrypt and other stuff still to be done, but the framework is working.

The steps I did:

  1. Installed requirements (as mariadb, …) ;
  2. Configured apache virtual host to handle my own site and the nextcloud one;
  3. Installed nextcloud from the source in GIT;
  4. Installed php’s modules nextcloud complained that they were missing;
  5. Populate the DB with
root@fedehome:~# cd /opt/nextcloud_data/
root@fedehome:/opt/nextcloud_data# sudo -u www-data php /var/www/html/nextmune.munerotto.it/console.php  files:scan --all

using the files already copied there from the PI’s SD
6. Create admin on nextcloud;
7. Create normal user (same name it has on the Raspberry).

So far so good, here comes the bad news.

When NC was on the PI I had several documents with the internal links: when you press on the URL in the document, Firefox -if you logged in NC’s site- shows the linked file.

Now the links no more work: they point to wrong location.

How can I fix those thousands of lost links ?