-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
gitea database dump doesn't escape LF character #6907
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
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Hello, I encounter the same issue with I think I will try to write a script to patch my backup to convert Thanks! |
I also encounter this problem when trying to restore a backup from Gitea 1.8.0 on a recent release. This workaround worked for me:
However considering the numerous issues I noted at #9100 (comment) you may want to remove the dump command altogether from gitea, and simply provide backup instructions (dump the database using standard tools, backup the dump and data directory) |
For temp solution, we can use database dump tool, for example on MySQL mysqldump -h192.168.1.xxx -uxxx -pxxx -P3306 --single-transaction --set-gtid-purged=OFF --column-statistics=0 --default-character-set=utf8mb4 --databases gitea > gitea.sql then import to MySQL mysql --default-character-set=utf8mb4 -uxxx -pxxx gitea < gitea.sql |
I also use standard filesystem/database tools to manage gitea backups. It has been more reliable so far:
|
It would be helpful to report which versions of Gitea have this problem and if they are fixed on the newer versions. (including 1.14 - where it should be fixed) |
[x]
):When exporting via
gitea dump
,the\n
at then end of commit message title (in columncontent
of tableaction
) is not properly escaped.I've checked that this happens when exporting both from MySQL and NoSQL databases. As an example,
Notice the
Message":"test \\n \\r \\t\n"
. The special characters are escpaed, except the last\n
.This can cause mashalling errors when the dump is later imported into a database, see #6793.
The text was updated successfully, but these errors were encountered: