Backup NodeRed without WebGUI

You might be able to start Node-red in safe mode node-red --safe

You might be able to repair Node-red by running the installation script again.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Failing that your flows are in a couple of files specified in ~/.node-red/settings.js. Look for a line like this

flowFile: 'flows.json',

( ie flows are in ~/.node-red/flows.json, and encrypted credentials in ~/.node-red/flows_cred.json)

You can do a simple backup of the entire ~/.node-red directory using command line tools such as
tar cvf noderedbackup.tar .node-red
To restore from this backup:
Install Node-red using the script.
Put the backup file in your home directory.
tar xvf noderedbackup.tar

Either backup method will save your flows but any additional nodes you have installed will have to be reinstalled on the new machine.