You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all we would have to do us drop the table (when ready), then take the old database and for each row grab the full url and use urllib to do a "/url/FULLURL" kind of thing for each and since the shortened url is made off the auto_incrementing id column for each insert, they should match up.
Once they are verified to match, we can backup old database and take it down.
The text was updated successfully, but these errors were encountered:
Also, the old database started with id=18 so if we import we are off by 18 in id and thus creating the shorturl (via base62 of id). So one way would be to input 17 urls, then instead of dropping table, just delete from shortener_stumps where 1=1; then mass import with: sql = 'select id,longurl,shorturl from urls' cursor.execute(sql) for row in cursor: url = 'http://192.168.11.4/url/'+urllib.quote_plus(row[0]) f = urllib.urlopen(url) f.read()
ALSO
some of the early urls had self domain in them which we now reject. So we might want to skip ahead (e.g. starting at 25 on our new db and skipping first 7 on the old if the first 7 were test ones). Have to temporarily disable the netloc check in the submit view.
ALSO
we can even include the old visits count since:
hits = models.PositiveIntegerField("Number of visits",default=1,editable=False)
we can just figure out a way to send in the hits on teh command line somehow via url liek maybe appending &stumpyhits=HITS to each url then in the submit view use urlparse to strip off $stumpyhits=HITS and get value of HITS and use that to feed into the hits column. nifty i know
should we dump in the old urls?
all we would have to do us drop the table (when ready), then take the old database and for each row grab the full url and use urllib to do a "/url/FULLURL" kind of thing for each and since the shortened url is made off the auto_incrementing id column for each insert, they should match up.
Once they are verified to match, we can backup old database and take it down.
The text was updated successfully, but these errors were encountered: