PhoneTrack location/offline backup

Hi, I have an old version of Nextcloud refusing to upgrade, is it possible to export from its location the data from PhoneTracker, then recreate a new version of Nextcloud and import the backup in the new version?

You can export any phonetrack session to a *.gpx file:

image

Later you can import this .gpx-file:

image

… the obvious answer is yes.

1 Like

I don’t have access to the nextcloud instance

I have access to the files, but I’m unable to start it.

Then you should save the database tables beginning with oc_phonetrack_ and import them in the new database.

(assuming your table prefix is oc_, your database is called nextcloud and your database is MariaDB/mysql)

Dumping the tables from the source database:

  1. Open a terminal window on the server where the source MariaDB database is located.
  2. Use the following command to dump all tables starting with nc_phonetrack_ from the nextcloud database to a single SQL file:
mysqldump --single-transaction --quick --default-character-set=utf8mb4 -h localhost -u $your_database_username -p nextcloud nc_phonetrack_* > nc_phonetrack_dump.sql

Replace $your_database_username with your MariaDB username. You’ll be prompted to enter your MariaDB password (from config/config.php) after running this command.
3. This will create a file called nc_phonetrack_dump.sql in the current directory containing the dumped data.

Importing the tables into the target database:

  1. Open a terminal window on the target server.
  2. Use the following command to import the dump file into the target database:
mysql --default-character-set=utf8mb4 -u $your_database_username -p nextcloud --collation=utf8mb4_unicode_ci < /path/to/nc_phonetrack_dump.sql

Replace $your_database_username with your MariaDB username on the target server, /path/to/ with the path to the dump file on the target server, and nextcloud with the name of the database you want to import the tables into.You’ll be prompted to enter your MariaDB password. After the import is complete, the tables should be available in the target database.

Now you can install phonetrack again and it will use the data from the database.

(without guarantee)

1 Like

Thanks, I’m trying “sqlite3 old_nextcloud.db | grep oc_phonetrack_ | sqlite3 nextcloud.db”

Dump:

sqlite3 mydatabase.db ".dump 'oc_phonetrack_%'" > oc_phonetrack_dump.sql

Import:

sqlite3 myotherdatabase.db < /path/to/oc_phonetrack_dump.sql
2 Likes