43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"federated.computer/wp-sync-slowtwitch/services/migration"
|
|
"fmt"
|
|
)
|
|
|
|
const baseUrl = "https://slowtwitch.cloud/wp-json/"
|
|
const wordpressKey = "admin@slowtwitch.cloud"
|
|
const wordpressSecret = "6zY7 xsKZ dGIt l1Lp ypIK 6TWh"
|
|
|
|
const slowtwitchAdminUser = "admin"
|
|
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
|
|
const slowtwitchDbName = "slowtwitch"
|
|
const migrationDbName = "slowtwitch_transfer"
|
|
const federatedDbUrl = "slowtwitch.northend.network"
|
|
const federatedDbPort = "3306"
|
|
|
|
var appCache AppCache
|
|
|
|
func main() {
|
|
// TODO Category migration
|
|
// TODO User migration
|
|
// TODO Article migration
|
|
slowtwitchDB, slowtwitchDbErr := migration.Connect(slowtwitchAdminUser, slowtwitchAdminPass, federatedDbUrl, federatedDbPort, slowtwitchDbName)
|
|
if slowtwitchDbErr != nil {
|
|
fmt.Println(slowtwitchDbErr)
|
|
}
|
|
resultsDB, resultsDBerr := migration.Connect(slowtwitchAdminUser, slowtwitchAdminPass, federatedDbUrl, federatedDbPort, migrationDbName)
|
|
if resultsDBerr != nil {
|
|
fmt.Println(resultsDBerr)
|
|
}
|
|
|
|
categoryMigration := migration.MigrateCategories{
|
|
SlowtwitchDatabase: slowtwitchDB,
|
|
ResultsDatabase: resultsDB,
|
|
WordpressBaseUrl: baseUrl,
|
|
WordpressUser: wordpressKey,
|
|
WordpressPassword: wordpressSecret,
|
|
}
|
|
categoryMigration.Execute()
|
|
}
|