First Test Run Complete
- TODO Thread Post Creation - TODO Hunt Down Broken Slideshow Links
This commit is contained in:
parent
c62667578c
commit
93f5c70236
4
main.go
4
main.go
@ -79,6 +79,6 @@ func migratePosts() {
|
|||||||
WordpressUser: wordpressKey,
|
WordpressUser: wordpressKey,
|
||||||
WordpressPassword: wordpressSecret,
|
WordpressPassword: wordpressSecret,
|
||||||
}
|
}
|
||||||
postMigration.Execute()
|
results := postMigration.Execute()
|
||||||
fmt.Println("Migration complete, please check database for results.")
|
fmt.Println("Migration complete, migrated", len(results), "Posts")
|
||||||
}
|
}
|
||||||
|
BIN
results.txt
Normal file
BIN
results.txt
Normal file
Binary file not shown.
@ -89,6 +89,13 @@ func (migration MigratePosts) Execute() []PostResult {
|
|||||||
wordPressCategoryIds = append(wordPressCategoryIds, categoryResult.WordpressId)
|
wordPressCategoryIds = append(wordPressCategoryIds, categoryResult.WordpressId)
|
||||||
firstCategoryResult = categoryResult
|
firstCategoryResult = categoryResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(wordPressCategoryIds) == 0 {
|
||||||
|
errorMessage = "This post has no categories and is broken on the production site."
|
||||||
|
createPostFailureResult(postId, errorMessage, migration.ResultsDatabase)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
createWordpressPost.Categories = wordPressCategoryIds
|
createWordpressPost.Categories = wordPressCategoryIds
|
||||||
//Get Author ID
|
//Get Author ID
|
||||||
editor, findEditorErr := GetEditor(postBase.Author, migration.ResultsDatabase)
|
editor, findEditorErr := GetEditor(postBase.Author, migration.ResultsDatabase)
|
||||||
|
@ -27,5 +27,6 @@ func convert(path string) string {
|
|||||||
output = strings.ReplaceAll(output, ")", "_")
|
output = strings.ReplaceAll(output, ")", "_")
|
||||||
output = strings.ReplaceAll(output, "?", "")
|
output = strings.ReplaceAll(output, "?", "")
|
||||||
output = strings.ReplaceAll(output, ",", "")
|
output = strings.ReplaceAll(output, ",", "")
|
||||||
|
output = strings.ReplaceAll(output, "%", "%25")
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user