Restoring the user DB (Mojo branch)

From DXSpider Documentation Wiki
Revision as of 00:29, 8 April 2025 by WI3W (talk | contribs) (Expand on usage and procedure)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

From the linux command line as the login user. Note: the sysop user should under no circumstance have sudo privileges.

Stop the service:

 sudo service dxspider stop

From the command line as sysop user:

Change to the directory that contains the user backup: user_json

 cd /spider/local_data

Run regeneration of users.v3j

perl user_json

Start cluster service

sudo service dxspider start

Back-up or Transfer User DB

To backup and/or transfer the user database we will use the 'export_json' command in the sysop console. From the software 'help export_json':

EXPORT_USERS [<filename>] Export the users database to ascii
 Export the users database to a file in ascii format. If no filename
 is given then it will export the file to /spider/data/user_asc.

 If the file already exists it will be renamed to <filename>.o. In fact
 up to 5 generations of the file can be kept each one with an extra 'o' on the
 suffix.

 BE WARNED: this will write to any file you have write access to. No check is
 made on the filename (if any) that you specify.

On the origin node, in the sysop console:

export_json /tmp/example_json - (this creates the file /tmp/example_json)

As the sysop user (or a user with suitable privilege) at the linux prompt, the backup can be moved to a backup directory or transferred to external media:

cp /tmp/example_json /home/sysop/backup/ - (this is only an example, your case may be different)

At this point you now have a backup of the user database.

To transfer the user database to a new node...

On the new node, at the linux prompt as the login user (again sysop should under no circumstances have sudo privilege):

sudo service dxspider stop

Copy the user_json from above to /spider/local_data/user_json:

cp /<source dir name>/user_json /spider/local_data/user_json

Then we need to tell the node there is a new user database:

/spider/perl/update_sysop.pl

Now start the DXSpider service:

sudo service dxspider start

Verify that the new user database loaded with information specific to your node. i.e registered users

At the sysop console:

show/registered