Comments (6)
Oh, respect for that wiki size. I'll have to look into it, but by default there is no way. I'll think about it.
from caramelize.
Actually it's not to hard. You can run a slightly changed version of the WikkaWiki adapter in which you modify the query to your database. For this you create a new custom wiki adapter. Create a wikka_wiki_resume_progress_at_id.rb
in the directory where you run caramelize and add this content:
require 'caramelize/input_wiki/wiki'
require 'caramelize/input_wiki/wikkawiki'
# Within this method you can define your own Wiki-Connectors to Wikis
# not supported by default in this software
def input_wiki
options = { host: "localhost",
username: "user",
database: "database_name",
password: 'admin_password',
markup: :wikka,
filters: [ Caramelize::Wikka2Markdown]
}
wiki = Caramelize::InputWiki::Wiki.new(options)
wiki.instance_eval do
def read_pages
start_progress_at_id = 47
sql = "SELECT id, tag, body, time, latest, user, note FROM wikka_pages WHERE id > #{start_progress_at_id} ORDER BY time;"
results = database.query(sql)
results.each do |row|
titles << row["tag"]
author = authors[row["user"]]
properties = { id: row["id"],
title: row["tag"],
body: row["body"],
markup: :wikka,
latest: row["latest"] == "Y",
time: row["time"],
message: row["note"],
author: author,
author_name: row["user"] }
page = Caramelize::Page.new(properties)
revisions << page
end
titles.uniq!
revisions
end
end
wiki
end
Modify the database credentials in the options
and change the start_progress_at_id
id in line 25 to the last id that was successfully imported in your first run.
Now run in your console:
$ caramelize run -c wikka_wiki_resume_progress_at_id.rb
It will prompt you if you want to overwrite the existing with a fresh repository, deny that.
It should continue to process your wiki and append to the git repository you created on the first run.
Let me know if it works. Good luck!
from caramelize.
Oh, by the way, by changing the SQL-query in line 27, you can also manually batch your export by defining id ranges you want to export.
from caramelize.
This is the same solution but with shorter code:
require 'caramelize/input_wiki/wikkawiki'
# Within this method you can define your own Wiki-Connectors to Wikis
# not supported by default in this software
def input_wiki
options = { host: "localhost",
username: "user",
database: "database_name",
password: 'admin_password',
home_page_title: 'dahie',
}
wiki = Caramelize::InputWiki::WikkaWiki.new(options)
wiki.instance_eval do
def pages
start_progress_at_id = 47
sql = "SELECT id, tag, body, time, latest, user, note FROM wikka_pages WHERE id > #{start_progress_at_id} ORDER BY time;"
@pages ||= database.query(sql)
end
end
wiki
end
from caramelize.
I tested the first variant. It worked great!
Thank you so much for the solution, and for your quick response, Dahie :)
Now I’m trying to figure out why the Wikka2Markdown filter didn’t seem to work, but that’s a different issue.
from caramelize.
Alright, it worked!
I'll close this issue. If you find a problem in the wikka wiki conversion, make a new one, please. :)
from caramelize.
Related Issues (11)
- Improve markup configuration for input wikis
- Detect if wiki.git by the same name exists HOT 1
- Use ActiveRecord for database-access HOT 1
- Config option for Home-page HOT 1
- Write DSL for configuration files
- Grit has encoding problems HOT 1
- Support Trac wiki
- Image support HOT 1
- Metrics for measuring migration quality
- Error extracting pandoc's information HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caramelize.