I''ve been using 0.10.2 (Oleg''s standa-lone binary version for MacOS X) for the past few months to accumulate a large amount of data. Now the time has come for me to export the entire bit as static HTML. However, as you probably know, export is broken in 0.10.2. This is critical data (that I probably shouldn''t have trusted to a proprietary program in the first place) that I *must* export to static HTML files. Are there any ideas on how I can get Instiki to give me back my data? Even if I can only get the Markdown code out of it, I''d be ok because I can just write a quick Python script to get everything back into shape. Thanks- Tyson
On 16/05/06, Tyson Tate <ttate at calpoly.edu> wrote:> <snip /> This is > critical data (that I probably shouldn''t have trusted to a > proprietary program in the first place) that I *must* export to > static HTML files. > <snip />instiki isn''t proprietary... never tried exporting from instiki myself but off the top of my head... somewhere you should have a folder called storage and that should have your data in it. Of course if all else fails you can always just view each page in a web browser and go to view -> view document source (that''s what it is in konqueror it may be elsewhere in safari/firefox try the edit menu too perhaps?) -- DO NOT SEND ME WORD ATTACHMENTS - I *WILL* BITE! <http://www.gnu.org/philosophy/sylvester-response.html> Hit me: <http://robin.shannon.id.au> [broken] Jab me: <robin.shannon at jabber.org.au> Upgrade to kubuntu linux: <http://releases.ubuntu.com/kubuntu/breezy/> Faith is under the left nipple. -- Martin Luther
On May 15, 2006, at 6:08 PM, Robin Shannon wrote:> instiki isn''t proprietary...Well, the snapshot files appear to be. They''re certainly not plaintext.> never tried exporting from instiki myself but off the top of my > head... somewhere you should have a folder called storage and that > should have your data in it. Of course if all else fails you can > always just view each page in a web browser and go to view -> view > document source (that''s what it is in konqueror it may be elsewhere in > safari/firefox try the edit menu too perhaps?)The storage folder contains all of the snapshots, which, as I mentioned above, are not easily readable. The problem with copying all of the HTML manually is that I have hundreds of pages and they''re heavily cross-linked. Converting them to a static site by hand would be a huge pain in the arse. I''ve installed Ruby on Rails and Instiki 0.11.0 on my local machine to try to migrate the Web to a working version of Instiki, but I can''t get it to create a new Web. I get the following when I try to: --- NoMethodError in Admin#create_system undefined method `files_path'' for nil:NilClass RAILS_ROOT: . #{RAILS_ROOT}/app/models/wiki_file.rb:49:in `content_path'' #{RAILS_ROOT}/app/models/web.rb:86:in `create_files_directory'' #{RAILS_ROOT}/app/models/wiki.rb:13:in `create_web'' #{RAILS_ROOT}/app/models/wiki.rb:70:in `setup'' #{RAILS_ROOT}/app/controllers/admin_controller.rb:17:in `create_system'' #{RAILS_ROOT}/instiki:6:in `load'' #{RAILS_ROOT}/instiki:6 --- Any ideas? Anyone? -Tyson
Sounds like you''re having a really rough time upgrading. Following are my notes from my upgrade to 0.11. They''re very long, but they cover how to export your current storage as SQL that can be imported into 0.11''s ActiveRecord DB storage. Hope it helps: Backup the existing wiki Export as markup? save the stylesheet tweaks somewhere Checkout the svn trunk: svn co http://svn.instiki.org/instiki/trunk instiki Create a database (My SQL?:) su mysql -p create database wiki; (CTRL+C) create a database.yml file: Place this in config/database.yml: development: adapter: mysql database: wiki username: root password: socket: /var/run/mysqld/mysqld.sock test: adapter: mysql database: wiki username: root password: socket: /var/run/mysqld/mysqld.sock production: adapter: mysql database: wiki username: root password: socket: /var/run/mysqld/mysqld.sock import the DB schema: rake migrate check that it works: Use ?./instiki -e development? on the development machine # ./instiki => Instiki started on http://0.0.0.0:2500 => Ctrl-C to shutdown; call with --help for options [2006-03-07 20:40:35] INFO WEBrick 1.3.1 [2006-03-07 20:40:35] INFO ruby 1.8.2 (2005-04-11) [i386-linux] [2006-03-07 20:40:35] INFO WEBrick::HTTPServer#start: pid=10544 port=2500 Migrate the 0.10 storage to 0.11 database: (Debian Sarge, gem installation) Create some symlinks in the 0.10.2 gem installation: # su # cd /usr/lib/ruby/gems/1.8/gems/instiki-0.10.2/ # mkdir vendor # cd vendor/ # ln -s ../../madeleine-0.7.1 madeleine-0.7.1 # ln -s ../../RedCloth-3.0.3 RedCloth-3.0.3 # ln -s ../../RedCloth-3.0.4 RedCloth-3.0.4 # ln -s ../../rubyzip-0.5.8 rubyzip-0.5.8 Export the 0.10.2 storage as SQL In the directory Instiki was checked out run: ruby scriptimport_storage -t /full/path/to/instiki0.10/storage -i /full/path/to/instiki0.10/installation -d mysql -o instiki_import.sql Eg: ruby script/import_storage -t /var/www/instiki/storage/2500 -i /usr/lib/ruby/gems/1.8/gems/instiki-0.10.2 -d mysql -o instiki_0.10.2_import.sql Import the SQL # su # mysql -p mysql> connect wiki mysql> source instiki_0.10.2_import.sql Execute ruby script/reset_references $ ruby script/reset_references Check that it still works In my case, the pages seemed to have come across OK, but the stylesheet tweaks had mostly been lost. Probably safest to back them up first and then apply them again afterwards. Cleaning up Bug in the migration file Line 48 of db/schema.rb says: t.column "additional_style", :string additional_style stores the stylesheet tweaks, and creating it as a string will limit the number of characters you can enter. To change it the hard way: # su # mysql -p mysql> connect wiki mysql> ALTER TABLE `webs` CHANGE `additional_style` `additional_style` TEXT NULL DEFAULT NULL; Then you?re almost able to save stylesheet tweaks, but first some bugs in the Wiki.authenticate method need to be remedied Bug in the Wiki.authenticate method from app/models/wiki.rb: def authenticate(password) password == (system.password || ''instiki'') end Hey that?s real secure! Let?s just all go and edit each other?s wiki?s using ?instiki? as the password. Besides that, after the migration process, the ?system? table was left empty, meaning that the original system password has been lost. To create a new system password: # script/console system = System.new system.password = "(new password)" system.save You?d still want to change that line in wiki.rb to: password == system.password No idea why it didn?t come across in the migration though. Mark Beattie http://blog.easyeikaiwa.com
Tyson Tate wrote:> I''ve installed Ruby on Rails and Instiki 0.11.0 on my local machine > to try to migrate the Web to a working version of Instiki, but I > can''t get it to create a new Web. I get the following when I try to: > > --- > NoMethodError in Admin#create_system > > undefined method `files_path'' for nil:NilClassThis likely means that you don''t have SWIG installed; this is a poorly documented requirement for the sqlite3-ruby gem on *nix and Mac OS X systems. If you use DarwinPorts, just do: sudo port install swig in a Terminal window. Otherwise, download and install SWIG from http://www.swig.org/. Try Instiki again; you may or may not need to rebuild the sqlite3-ruby gem after installing SWIG. -- John