Move node from RPi3B to RPi4 and now getting errors

Hello,

As the title suggests, I moved my storj operations from my RPI3B to my RPI4 as I was having performance issues.

I’ve followed through the installation steps to make sure I didn’t miss anything.
I moved my identity over which seems okay.
I can run both the setup and docker run command but after running the latter I get this in the logs;

Error: Error starting master database on storagenode: database: file is not a database
	storj.io/storj/storagenode/storagenodedb.(*DB).openDatabase:323
	storj.io/storj/storagenode/storagenodedb.(*DB).openExistingDatabase:305
	storj.io/storj/storagenode/storagenodedb.(*DB).openDatabases:281
	storj.io/storj/storagenode/storagenodedb.OpenExisting:248
	main.cmdRun:160
	storj.io/private/process.cleanup.func1.4:363
	storj.io/private/process.cleanup.func1:381
	github.com/spf13/cobra.(*Command).execute:852
	github.com/spf13/cobra.(*Command).ExecuteC:960
	github.com/spf13/cobra.(*Command).Execute:897
	storj.io/private/process.ExecWithCustomConfig:88
	storj.io/private/process.ExecCustomDebug:70
	main.main:385
	runtime.main:255

The only thing I changed in the setup command was the location of the data. I chose /mnt/storj instead.

Here it is for reference:

docker run --rm -e SETUP="true" \
--mount type=bind,source="/home/pi/.local/share/storj/identity/storagenode",destination=/app/identity \
--mount type=bind,source="/mnt/storj",destination=/app/config \
--name storagenode storjlabs/storagenode:latest

In the directory I noticed my folder is called storage rather than storagenode. Here is a overview of the /mnt/storj folder;

root@*******:/mnt/storj# ls
configbackup2.yaml  config.yaml    notifications.db  pricing.db      secret.db	storagebackup
configbackup.yaml   heldamount.db  orders	     revocations.db  storage	trust-cache.json

One thing to note, my node has been down for around 14 days now as I’m only now getting the time to move it. Will this be a problem going forward or only for this month?

Thank’s in advance

You should migrate data too, or at least connect the same disk to the rpi4.

You must not run SETUP=true in the case of migration!
If you did - you likely destroyed your node.

The identity without tied data is useless, the data without tied identity is useless too.

In data location the storage subfolder contains node’s data.

So, the correct path for docker is usually look like this:

/mnt/storj/
├── lost+found
└── storagenode6
    ├── config.yaml
    ├── identity
    │   ├── ca.1633472434.cert
    │   ├── ca.cert
    │   ├── ca.key
    │   ├── identity.1633472434.cert
    │   ├── identity.cert
    │   └── identity.key
    ├── orders
    │   ├── archive
    │   └── unsent
    ├── revocations.db
    ├── storage
    │   ├── bandwidth.db
    │   ├── blobs
    │   ├── garbage
    │   ├── heldamount.db
    │   ├── info.db
    │   ├── notifications.db
    │   ├── orders.db
    │   ├── piece_expiration.db
    │   ├── piece_spaced_used.db
    │   ├── pieceinfo.db
    │   ├── pricing.db
    │   ├── reputation.db
    │   ├── satellites.db
    │   ├── secret.db
    │   ├── storage-dir-verification
    │   ├── storage_usage.db
    │   ├── temp
    │   ├── trash
    │   └── used_serial.db
    └── trust-cache.json

Please, give me result of this command:

ls -l /mnt/storj

Hey Alexey,

Sorry, I should have mentioned I’ve moved the data across too.

Just to clarify, I don’t run the setup command on my RPi4? If I have, can I write a fresh OS to my SD card and start again?
I was following this guide but I must have misread the setup part. How do I migrate my node to a new device? - Node Operator

I’ve cleaned up my root folder as I had a number of backup db’s from when I had an error a few weeks ago.

The folder structure is now similar to yours.

root@******:/mnt/storj# ls -l /mnt/storj
total 80
drwxr-xr-x 3 root root  4096 Oct 15 12:23 backups
drwx------ 2 root root 36864 Jun  5 20:12 lost+found
drwx------ 4 root root  4096 Mar 24  2021 orders
-rw------- 1 root root 32768 Oct  6 07:14 revocations.db
drwx------ 7 root root  4096 Oct 15 10:45 storage
drwxr-xr-x 2 root root  4096 Oct 15 12:21 storagenode
-rw------- 1 root root  2730 Oct  6 12:15 trust-cache.json

thank you for your help

If so, I would recommend to move your identity to the disk with data.

Please, give me result of these commands:

ls -l /mnt/storj/storage

and

ls -l /mnt/storj/storagenode

Okay, I have moved the Identity folder to the recommended place on the disk.

I noticed my paths were slightly different to what you mentioned so I corrected them Here is the output of
ls -l /mnt/storj:

pi@******:/mnt/storj $ ls -l
total 44
drwxr-xr-x 3 root root 4096 Oct 15 12:23 backups
drwx------ 2 root root 36864 Jun 5 20:12 lost+found
drwxr-xr-x 5 root root 4096 Oct 15 13:30 storagenode

For ls -l /mnt/storj/storagenode:

pi@******:/mnt/storj $ ls -l storagenode/
total 52
-rw------- 1 root root  9355 Oct 15 10:44 config.yaml
drwxr--r-- 2 pi   pi    4096 Oct 15 10:14 identity
drwx------ 4 root root  4096 Mar 24  2021 orders
-rw------- 1 root root 32768 Oct  6 07:14 revocations.db
drwx------ 7 root root  4096 Oct 15 10:45 storage
-rw------- 1 root root  2730 Oct  6 12:15 trust-cache.json

and the new storage location: /mnt/storj/storagenode/storage:

root@******:/mnt/storj/storagenode# ls -l storage/
total 25192
-rw-r--r-- 1 root root 12828672 Sep 28 11:13 bandwidthcopy.db
-rw-r--r-- 1 root root    32768 Sep 28 12:48 bandwidthcopy.db-shm
-rw-r--r-- 1 root root        0 Sep 28 11:30 bandwidthcopy.db-wal
-rw-r--r-- 1 root root 10379264 Oct  6 13:56 bandwidth.db
drwx------ 8 root root     4096 Mar 24  2021 blobs
-rw------- 1 root root     9355 Oct 15 10:25 config.yaml
-rw-r--r-- 1 root root     3030 Sep 28 12:49 dump_all_notrans.sql
-rw-r--r-- 1 root root     3057 Sep 28 12:49 dump_all.sql
drwx------ 2 root root     4096 Oct  6 14:02 garbage
-rw-r--r-- 1 root root    40960 Oct  6 07:44 heldamount.db
-rw-r--r-- 1 root root    32768 Oct  6 13:54 heldamount.db-shm
-rw-r--r-- 1 root root        0 Oct  6 13:54 heldamount.db-wal
-rw-r--r-- 1 root root    16384 Oct  6 07:44 info.db
-rw-r--r-- 1 root root    24576 Oct  6 07:44 notifications.db
-rw-r--r-- 1 root root    32768 Oct  6 13:54 notifications.db-shm
-rw-r--r-- 1 root root        0 Oct  6 13:54 notifications.db-wal
-rw-r--r-- 1 root root    32768 Oct  6 07:44 orders.db
-rw-r--r-- 1 root root  1839104 Oct  6 11:49 piece_expiration.db
-rw-r--r-- 1 root root    24576 Oct  6 07:44 pieceinfo.db
-rw-r--r-- 1 root root    32768 Oct  6 13:18 pieceinfo.db-shm
-rw-r--r-- 1 root root        0 Oct  6 13:18 pieceinfo.db-wal
-rw-r--r-- 1 root root    24576 Oct  6 07:44 piece_spaced_used.db
-rw-r--r-- 1 root root    24576 Oct  6 07:44 pricing.db
-rw-r--r-- 1 root root    32768 Oct  6 11:47 reputation.db
-rw-r--r-- 1 root root    32768 Oct  6 13:54 reputation.db-shm
-rw-r--r-- 1 root root        0 Oct  6 13:54 reputation.db-wal
-rw-r--r-- 1 root root    32768 Oct  6 07:45 satellites.db
-rw-r--r-- 1 root root        3 Oct  6 13:57 satellites.db-shm
-rw-r--r-- 1 root root        0 Oct  6 13:57 satellites.db-wal
-rw-r--r-- 1 root root    24576 Oct  6 07:44 secret.db
drwx------ 6 root root     4096 Oct 15 10:25 storage
-rw-r--r-- 1 root root       32 Oct 15 10:44 storage-dir-verification
-rw-r--r-- 1 root root   225280 Oct  6 07:44 storage_usage.db
drwx------ 2 root root    16384 Oct  6 14:02 temp
drwx------ 8 root root     4096 Apr 10  2021 trash
-rw-r--r-- 1 root root    20480 Oct  6 07:44 used_serial.db
-rw------- 1 root root        0 Sep 12 07:34 write-test164129708
-rw------- 1 root root        0 Sep  9 02:26 write-test517214412
-rw------- 1 root root        0 Sep  4 14:53 write-test546148981
-rw------- 1 root root        0 Oct  6 06:32 write-test811297650

Please, check all databases (run commands with sudo, since owner is root): https://support.storj.io/hc/en-us/articles/360029309111-How-to-fix-a-database-disk-image-is-malformed-
If some databases will return “file is not database”, then the fix for them would be: https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error

If you added your user to the docker group and want to run docker without sudo, you will need to change an owner to your user instead of root with the command sudo chown your_user -R /mnt/storj.