Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LDV Specification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
LDV Specification
Commits
740811d9
Commit
740811d9
authored
2 years ago
by
Roy de Goei
Browse files
Options
Downloads
Patches
Plain Diff
SDC-685
: Create initial script for migrating data from ldvadmin to ldvspec database
parent
af0bb4c1
No related branches found
No related tags found
1 merge request
!4
SDC-685: Script which migrates ldvadmin data to ldv-spec-db
Pipeline
#33633
passed
2 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ldvspec/ldvspec/migrate_ldvadmin_to_ldvspec.py
+41
-0
41 additions, 0 deletions
ldvspec/ldvspec/migrate_ldvadmin_to_ldvspec.py
with
41 additions
and
0 deletions
ldvspec/ldvspec/migrate_ldvadmin_to_ldvspec.py
0 → 100644
+
41
−
0
View file @
740811d9
#!/usr/bin/env python3
import
logging
import
datetime
import
pymysql
import
argparse
import
os
import
django
import
sys
import
re
LAST_UPDATE
=
"
25 July 2022
"
logger
=
logging
.
getLogger
(
__file__
)
handler
=
logging
.
StreamHandler
(
sys
.
stdout
)
handler
.
setLevel
(
logging
.
DEBUG
)
formatter
=
logging
.
Formatter
(
'
%(asctime)s - %(name)s - %(levelname)s - %(message)s
'
)
handler
.
setFormatter
(
formatter
)
logger
.
addHandler
(
handler
)
def
main
():
"""
Migrates data from the ldvadmin database to a ldvspec database.
"""
logging
.
basicConfig
(
format
=
'
%(asctime)s %(levelname)s %(message)s
'
,
level
=
logging
.
DEBUG
)
# Check the invocation arguments
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--version
"
,
default
=
False
,
help
=
"
Show current version of this program
"
,
action
=
"
store_true
"
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
default
=
False
,
help
=
"
More information at run time.
"
,
action
=
"
store_true
"
)
args
=
parser
.
parse_args
()
if
args
.
version
:
print
(
"
--- migrate_ldvadmin_to_ldvspec.py (last updated {}) ---
"
.
format
(
LAST_UPDATE
))
return
if
__name__
==
"
__main__
"
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment