Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] import/export database in the panel #347

Merged
merged 13 commits into from
May 6, 2023

Conversation

hamid-gh98
Copy link
Contributor

  • added feature to import/export database in the panel in backup modal
  • added api route to upload db 'server/importDB'
  • updated translation

@MHSanaei
Copy link
Owner

MHSanaei commented May 5, 2023

thanks again can you just remove the last part about migration I revert Cobra PR it was a mistake to accept that

@hamid-gh98
Copy link
Contributor Author

No problem, Done!

@MHSanaei
Copy link
Owner

MHSanaei commented May 5, 2023

I just test it now but when I try to upload my database I got this error
"Fail: Error backup temporary db file: rename /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.backup: The process cannot access the file because it is being used by another process."

@MHSanaei
Copy link
Owner

MHSanaei commented May 5, 2023

update2: I just checked my database import to inbound
but still, I got that error
and xray needs to be restarted please add auto restart for that
thank you so much

@hamid-gh98
Copy link
Contributor Author

update2: I just checked my database import to inbound but still, I got that error and xray needs to be restarted please add auto restart for that thank you so much

I have tested it and it is working for me. Could you please check if it is being used by another process, such as a database manager?
Additionally, Xray will automatically restart once the import is complete.

@hamid-gh98
Copy link
Contributor Author

I've made some changes. Would you mind testing it now?

@MHSanaei
Copy link
Owner

MHSanaei commented May 5, 2023

xray config problem is solved thanks for that, but if you check the database file it's empty it just made a temp file everything is on that because can't replace it when it's used by the panel

Screenshot 2023-05-06 012804

@hamid-gh98
Copy link
Contributor Author

hamid-gh98 commented May 6, 2023

but if you check the database file it's empty it just made a temp file everything is on that because can't replace it when it's used by the panel

I have tried several times and everything appears to be working fine.

Could you please check it now?
Did it throw any errors during this process?

The function stops the Xray, moves the database from the temp file to the db location, and then restarts Xray.

It's possible that another program is currently using it. can you try the following ?

  • Close other programs or processes that may be using it.
  • Check if there are any permission issues that might be preventing access.

@MHSanaei MHSanaei merged commit ac31d6d into MHSanaei:main May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants