First Test Run Complete

- TODO Thread Post Creation
- TODO Hunt Down Broken Slideshow Links
This commit is contained in:
Ross Trottier 2024-05-23 07:41:47 -06:00
parent c62667578c
commit 93f5c70236
4 changed files with 10 additions and 2 deletions

View File

@ -79,6 +79,6 @@ func migratePosts() {
WordpressUser: wordpressKey,
WordpressPassword: wordpressSecret,
}
postMigration.Execute()
fmt.Println("Migration complete, please check database for results.")
results := postMigration.Execute()
fmt.Println("Migration complete, migrated", len(results), "Posts")
}

BIN
results.txt Normal file

Binary file not shown.

View File

@ -89,6 +89,13 @@ func (migration MigratePosts) Execute() []PostResult {
wordPressCategoryIds = append(wordPressCategoryIds, categoryResult.WordpressId)
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
//Get Author ID
editor, findEditorErr := GetEditor(postBase.Author, migration.ResultsDatabase)

View File

@ -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, "%", "%25")
return output
}