#4785 URL shortener app migration paster command

v1.0.0
closed
nobody
42cc (432)
General
Cory Johns
2015-08-20
2012-08-24
Cory Johns
No

Once [#4637] is done, we will need a paster command to migrate the data from the existing MySQL tables. An example dump of the table is attached.

Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will need to come from the config files (production.ini, with a key like sfx.hostedapps_db.hostname).

Fields should be matched up as follows:

  • url = url
  • short_name = short_id
  • description = description
  • private = private
  • create_user = create_user
  • created = create_time
  • last_updated = edit_time

Other fields from the SQL table should be dropped.

The create_user field should match the sfx_userid field on the allura.model.User model and should be translated to the correct ID for the Allura app (presumably the _id field).

The url and description field should handle unicode values properly.

1 Attachments

Related

Tickets: #4637
Tickets: #4785

Discussion

  • Cory Johns - 2012-08-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,6 @@
     Once [#4637] is done, we will need to migrate the data from the existing MySQL tables.  An example dump of the table is attached.
    
    -Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will remain the same (localhost, sfurl table).
    +Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will need to come from the config files (`production.ini`).
    
     Fields should be matched up as follows:
    
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,6 @@
     Once [#4637] is done, we will need to migrate the data from the existing MySQL tables.  An example dump of the table is attached.
    
    -Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will need to come from the config files (`production.ini`).
    +Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will need to come from the config files (`production.ini`, with a key like `sfx.hostedapps_db.hostname`).
    
     Fields should be matched up as follows:
    
     

    Related

    Tickets: #4637

  • Cory Johns - 2012-08-24
    • summary: URL shortener app migration --> URL shortener app migration paster command
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Once [#4637] is done, we will need to migrate the data from the existing MySQL tables.  An example dump of the table is attached.
    +Once [#4637] is done, we will need a paster command to migrate the data from the existing MySQL tables.  An example dump of the table is attached.
    
     Since each project has its own database, the database name as well as destination project will need to be passed on the command-line, but the rest of the connection information will need to come from the config files (`production.ini`, with a key like `sfx.hostedapps_db.hostname`).
    
     

    Related

    Tickets: #4637

  • Igor Bondarenko - 2012-09-07

    Created #163: [#4785] URL shortener app migration paster command (2cp)

    • status: open --> in-progress
     

    Related

    Tickets: #4785

  • Igor Bondarenko - 2012-09-10

    Closed #163. Branch 42cc_4785.

    Usage example:

    $ paster migrate-urls ../Allura/development.ini urls 504867768fd0920bb8c21ffd
    

    Available options:

    $ paster migrate-urls -h
    Usage: paster migrate-urls [options] <ini file> <database name> <project>
    Migrate short urls from MySQL tables to ShortUrlApp
        <database name> - MySQL database name to load data from
            the rest of the connection information comes from ini file:
                sfx.hostedapps_db.hostname - database hostname
                sfx.hostedapps_db.port - database port
                sfx.hostedapps_db.username - database username
                sfx.hostedapps_db.password - user password
        <project> - the project id to load data to
    
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-09-10
    • qa: Cory Johns
     
  • Cory Johns - 2012-10-02
    • status: code-review --> closed
    • milestone: forge-backlog --> forge-oct-05
     
  • Dave Brondsema

    Dave Brondsema - 2012-10-03
    • status: closed --> validation
     
  • Dave Brondsema

    Dave Brondsema - 2012-10-25
    • size: --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2013-01-09

    We should update this code to use the same "hostedapps" ini settings set up in https://trac.geek.net/trac/siteops/ticket/52623 for the mediawiki importer

     
  • Dave Brondsema

    Dave Brondsema - 2013-05-08

    unique_indexes = ['short_name'] might be a problem.

    I think it should be unique per project.

     
  • Dave Brondsema

    Dave Brondsema - 2013-05-17
    • Milestone: forge-may-17 --> forge-may-31
     
  • Dave Brondsema

    Dave Brondsema - 2013-05-20
    • Milestone: forge-may-31 --> forge-jun-06
     
  • Cory Johns - 2013-05-31
    • status: validation --> closed
    • Size: 1 --> 0
     

Log in to post a comment.