-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
WIP: Reimplement dump and implment restore command #2917
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2917 +/- ##
==========================================
- Coverage 39.4% 20.11% -19.3%
==========================================
Files 393 145 -248
Lines 53264 29252 -24012
==========================================
- Hits 20990 5884 -15106
+ Misses 29287 22474 -6813
+ Partials 2987 894 -2093
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the gitea dump
command for a while and create a gitea backup
command instead.
cmd/dump.go
Outdated
@@ -1,5 +1,5 @@ | |||
// Copyright 2014 The Gogs Authors. All rights reserved. | |||
// Copyright 2016 The Gitea Authors. All rights reserved. | |||
// Copyright 2017 The Gitea Authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the copyright year ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in fact all contents changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it has not 🤔
Any ETA on this? |
models/models.go
Outdated
|
||
var bufferSize = 100 | ||
v := reflect.MakeSlice(table.Type, 0, bufferSize) | ||
// BLOCK: need yaml support gonic name mapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There have been 61 commits to go-yaml/yaml
since it was forked into the go-gitea
org. Is this still blocked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check that.
6b392aa
to
9a9a0bc
Compare
@@ -0,0 +1,153 @@ | |||
// Copyright 2017 The Gitea Authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this file is entirely new, I know you wrote it in 2017, however it is likely to get merged in 2018 should this date be updated to 2018?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright year should be the time first created I think.
@lunny It looks like you've made some recent commits to this. Can the |
@techknowlogick It still cannot work fine when restore. |
Is there a possibility this will be merged into 1.5.0? |
@sphrak it's impossible since v1.5 has been freezed. I would like this could be in v1.6. |
@lunny I understand, thanks for communicating that :-) |
Any updates on this? I would like to migrate from SQLite to Postgres and therefor need this feature. |
Any chance this will be part of 1.7.0? |
@lunny I'd love to try and test this but can share a little light on the |
@cryptix you are welcome we need yaml support Gonic name mapping, maybe you could send a PR to yaml at first. |
9434bc7
to
c85526d
Compare
Any updates on this? Like jlelse I'm trying to do a database migration, and this should make my life so much easier. |
Any updates on this? I would like to migrate from SQLite to Postgres and therefore need this feature. |
For those who are curious about how to migrate data from sqlite to postgresql, see this link: #5651 (comment) |
It looks like this PR is still relevant because the restore process still is manual. |
This is in progress for a while now, I'm closing it. Please reopen when it's ready for review. |
This PR would like to replace #1637. It reimplemented
dump
command and old dump file will not be used anymore. And also added a restore command that could restore dumped zip file to some machine. You have to use the same version Gitea withdump
whenrestore
.The dump databases will be stored as
<table_name>.yml
in one directory. This format is expected to be compatible with Gitea's test fixtures. So that it's easy to export test data from a real system.Currently it's blocked because yaml package didn't support Gonic name mapping, so I have forked yml package to https://github.com/go-gitea/yaml. Before that package supports that feature, this PR is not really work.