Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否支持 isso 格式的评论导入? #546

Closed
tiann opened this issue Sep 13, 2021 · 4 comments
Closed

能否支持 isso 格式的评论导入? #546

tiann opened this issue Sep 13, 2021 · 4 comments
Labels
waiting for response Reply is wanted

Comments

@tiann
Copy link

tiann commented Sep 13, 2021

No description provided.

@lizheming
Copy link
Collaborator

可以提供下导出的数据给我们,我们这边做下适配处理

@tiann
Copy link
Author

tiann commented Sep 14, 2021

数据是一个 sqlite3 的数据库,见这里:

comments.db.zip

有什么其他需要提供的我这边也方便

@tiann
Copy link
Author

tiann commented Sep 14, 2021

我做过如下尝试,先把 isso 转成 disqus 格式,然后再用 disqus 格式迁移,但是迁移得到的文件是空的

@lizheming lizheming added enhancement New feature or request help wanted Extra attention is needed question labels Sep 14, 2021
@lizheming
Copy link
Collaborator

写了个简单的 SQL 语句,帮助你将 isso 的 comments 表转换成 Waline 的 wl_Comment 表,直接在你的 SQLite 数据库中执行以下语句应该就可以了,你可以试试。

CREATE TABLE "wl_Comment" (
	"id"	INTEGER,
	"user_id"	INTEGER,
	"comment"	TEXT,
	"insertedAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	"ip"	TEXT,
	"link"	TEXT,
	"mail"	TEXT,
	"nick"	TEXT,
	"pid"	INTEGER,
	"rid"	INTEGER,
	"status"	TEXT NOT NULL,
	"ua"	TEXT,
	"url"	TEXT,
	"createdAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	"updatedAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE "wl_Counter" (
	"id"	INTEGER,
	"time"	INTEGER,
	"url"	TEXT,
	"createdAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	"updatedAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE "wl_Users" (
	"id"	INTEGER,
	"display_name"	TEXT NOT NULL,
	"email"	TEXT NOT NULL,
	"password"	TEXT NOT NULL,
	"type"	TEXT NOT NULL,
	"github"	TEXT,
	"avatar"	TEXT,
	"url"	TEXT,
	"createdAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	"updatedAt"	DATETIME DEFAULT (datetime('now', 'localtime')),
	PRIMARY KEY("id" AUTOINCREMENT)
);
INSERT INTO `wl_Comment` (
	`id`,
	`user_id`,
	`comment`,
	`ip`,
	`link`,
	`mail`,
	`nick`,
	`pid`,
	`rid`,
	`status`,
	`ua`,
	`url`,
	`insertedAt`,
	`createdAt`,
	`updatedAt`
) SELECT 
    `comments`.`id` as `id`,
    NULL as `user_id`,
    `text` as `comment`,
    `remote_addr` as `ip`,
    `website` as `link`,
    `email` as `mail`,
    `author` as `nick`,
    `parent` as `pid`,
    `parent` as `rid`,
    "approved" as `status`,
    NULL as `ua`,
    `threads`.`uri` as `url`,
    datetime(`created`, "unixepoch") as `insertedAt`,
    datetime(`created`, "unixepoch") as `createdAt`, 
    datetime(`created`, "unixepoch") as `updatedAt`
 FROM `comments` LEFT JOIN `threads` ON `threads`.`id` = `comments`.`tid`;

@lizheming lizheming added waiting for response Reply is wanted and removed enhancement New feature or request help wanted Extra attention is needed labels Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Reply is wanted
Projects
None yet
Development

No branches or pull requests

2 participants