After a reinstall and reconfiguration, I lost the container configuration in RouterOS.
Container adding seems to necessarily want to install from file or repository. Since I still have the container intact on the USB, is it possible to “point” the container configuration in RouterOS to the valid container on the USB without reinstalling it?
Correct way is to have mount points for container service data persistence so that container can be added/updated and service will load persisted files from mounted dirs (config and other files to load latest state) when configuration is reset.
After config reset/netinstall only way to run previously added container is to restore from backup (not config export), but backup needs to be created after container is added, even if is same container recreated for update, because container changes its name (random uuid), backup also needs to be created after to persist that name.
Other way is to use SFTP or connect usb external storage to local computer and backup all files from root dir that needs to recover service state, delete root dir, create container and copy/overwrite files back and fix copied files permissions if needed (check owner and permissions before deleting root dir). On Linux you can also use tar on local computer for backing up (with preserving ownership and permission on files) entire root dir and putting files back (also locally) when container is created.
Unfortunately, there is issues on mounting the USB from time to time during firmware upgrade. It could cause a loss in installed and configured containers and one needs to reinstall.
To me, I keep my container simple and uses environment parameters to make the recovery faster