|
a/scripts/tracker-rip.py |
|
b/scripts/tracker-rip.py |
|
... |
|
... |
16 |
# Credentials for sf-overlords
|
16 |
# Credentials for sf-overlords
|
17 |
DST_CRED=dict(
|
17 |
DST_CRED=dict(
|
18 |
api_key='a4a88c67179137053d70',
|
18 |
api_key='a4a88c67179137053d70',
|
19 |
secret_key='fcc48a0c31459e99a88cc42cdd7f908fad78b283ca30a86caac1ab65036ff71fc195a18e56534dc5')
|
19 |
secret_key='fcc48a0c31459e99a88cc42cdd7f908fad78b283ca30a86caac1ab65036ff71fc195a18e56534dc5')
|
20 |
DST_SERVER='http://sourceforge.net/'
|
20 |
DST_SERVER='http://sourceforge.net/'
|
21 |
DST_TOOL='/rest/p/forge/tickets/'
|
21 |
DST_TOOL='/rest/p/allura/tickets/'
|
22 |
|
22 |
|
23 |
FAKE_TICKET={
|
23 |
FAKE_TICKET={
|
24 |
u'created_date': u'2010-03-08 17:29:42.802000',
|
24 |
u'created_date': u'2010-03-08 17:29:42.802000',
|
25 |
u'assigned_to_id': u'',
|
25 |
u'assigned_to_id': u'',
|
26 |
u'assigned_to': u'',
|
26 |
u'assigned_to': u'',
|
|
... |
|
... |
41 |
dst_cli = rest_api.RestClient(
|
41 |
dst_cli = rest_api.RestClient(
|
42 |
base_uri=DST_SERVER,
|
42 |
base_uri=DST_SERVER,
|
43 |
**DST_CRED)
|
43 |
**DST_CRED)
|
44 |
src = TicketAPI(src_cli, SRC_TOOL)
|
44 |
src = TicketAPI(src_cli, SRC_TOOL)
|
45 |
dst = TicketAPI(dst_cli, DST_TOOL)
|
45 |
dst = TicketAPI(dst_cli, DST_TOOL)
|
46 |
for ticket in src.iter_tickets(check=True):
|
46 |
for ticket in src.iter_tickets(min_ticket=3, check=True):
|
47 |
print 'Migrating ticket %s:\n%s' % (ticket['ticket_num'], ticket)
|
47 |
print 'Migrating ticket %s:\n%s' % (ticket['ticket_num'], ticket)
|
48 |
print 'Create ticket on %s' % DST_SERVER
|
48 |
print 'Create ticket on %s' % DST_SERVER
|
49 |
dst.create_ticket(ticket)
|
49 |
dst.create_ticket(ticket)
|
50 |
print 'Create discussion on %s' % DST_SERVER
|
50 |
print 'Create discussion on %s' % DST_SERVER
|
51 |
src_thread = src.load_thread(ticket)
|
51 |
src_thread = src.load_thread(ticket)
|