Pier backup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Pier backup

Dmitry Dorofeev
Hi all,

The only thing which stops me to run personal wiki on Pier is the chances that I
can have my image corrupted. Is there any way to make a backup of Pier content
and full restore ? If I can run it daily would be nice.

Thanks.
-Dmitry.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup

Brian Chapados-2
This topic has come up before on the Pier (smallwiki) mailing list.  Check
these links:

# save/restore all data from a pier instance
http://www.iam.unibe.ch/pipermail/smallwiki/2006-March/001773.html
http://www.iam.unibe.ch/pipermail/smallwiki/2004-May/000615.html
http://minnow.cc.gatech.edu/squeak/2318

I use ReferenceStreams as follows:

" save Pier kernel instance "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
stream nextPut: (PRKernel instanceNamed: 'mykernelname') root.
stream close.

" load Pier kernel from stored objects "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
(PRKernel instanceNamed: 'mykernelname') root: stream next.
stream close.

Brian

> Hi all,
>
> The only thing which stops me to run personal wiki on Pier is the
chances
> that I
> can have my image corrupted. Is there any way to make a backup of Pier
content
> and full restore ? If I can run it daily would be nice.
>
> Thanks.
> -Dmitry.





_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup

Rick Flower
In reply to this post by Dmitry Dorofeev
Dmitry Dorofeev wrote:
> Hi all,
>
> The only thing which stops me to run personal wiki on Pier is the
> chances that I
> can have my image corrupted. Is there any way to make a backup of Pier
> content
> and full restore ? If I can run it daily would be nice.
Just to clarify.. I'm wondering if you're talking about some sort of
automated setup where
the image is flushed out (I don't know how pier stores its data -- I'm
assume it's stored in
the image directly) and then saved on a regular basis (perhaps nightly)
with a time/date
tag appended to the name to allow easy retrieval of earlier versions of
the image (e.g. non
corrupted)..

I was wondering this as well, and I'd be tempted to call this a form of
checkpointing
of the image and I would think that there must be an easy way to do this
in Smalltalk
since this issue doesn't quite apply to most other non-image based
languages.. This
also isn't specific to Pier as it can easily happen if I've got a
Seaside app that writes to
a database that lives within the image -- I'd certainly want to
checkpoint that database image
on a regular basis to ensure I lose nothing if the image is corrupted
somehow..  Anyway,
I guess you could setup things somehow (triggered off a timer?) to write
out your image
(I'm assuming there's a way to programmatically force an image save, but
I've got no
idea there) on a regular basis and to specify the image name to save
under..

Anyway, not sure if that is what the OP was looking for..


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup

David T. Lewis
On Thu, May 25, 2006 at 09:33:05AM -0700, Rick Flower wrote:
> somehow..  Anyway,
> I guess you could setup things somehow (triggered off a timer?) to write
> out your image
> (I'm assuming there's a way to programmatically force an image save, but
> I've got no
> idea there) on a regular basis and to specify the image name to save
> under..

If your server is running unix (or Linux), this should do what you want:

  "UnixProcess saveImageInBackgroundNicely"

The image will be saved with a time stamped file name. The save is done
in a lower priority background OS process that should have minimal
impact on your server image. You could for example set it up like
this:

  [[(Delay forSeconds: 4 * 60 * 60) wait. "wait 4 hours"
  UnixProcess saveImageInBackgroundNicely] repeat] fork

This requires the OSProcess package from SqueakMap.

I suspect that you could fill up a disk drive pretty quickly like this,
so you'll need to come up with some way to purge out the old image
files. Maybe someone who is doing this already can suggest a good
approach.

Dave

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup

Rick Flower
David T. Lewis wrote:

> If your server is running unix (or Linux), this should do what you want:
>
>   "UnixProcess saveImageInBackgroundNicely"
>
> The image will be saved with a time stamped file name. The save is done
> in a lower priority background OS process that should have minimal
> impact on your server image. You could for example set it up like
> this:
>
>   [[(Delay forSeconds: 4 * 60 * 60) wait. "wait 4 hours"
>   UnixProcess saveImageInBackgroundNicely] repeat] fork
>
> This requires the OSProcess package from SqueakMap.
>
> I suspect that you could fill up a disk drive pretty quickly like this,
> so you'll need to come up with some way to purge out the old image
> files. Maybe someone who is doing this already can suggest a good
> approach.
>  
Thanks.. That's pretty much what I was thinking of.. I figured there was
likely a way to do that..


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup

Dmitry Dorofeev
In reply to this post by Brian Chapados-2
Nice and easy, thanks.

The only question left unresolved is to how ensure that nobody
change Pier pages while I do backup. It is not quite necessary for
me personally. But would be nice to have a backup/restore functionality
embedded into Pier. That may show nice message like 'Sorry, Pier back up is action,
please wait and try to edit this page later.' to the user who updates the page.

Just an idea.

-Dmitry.

Brian Chapados wrote:

> This topic has come up before on the Pier (smallwiki) mailing list.  Check
> these links:
>
> # save/restore all data from a pier instance
> http://www.iam.unibe.ch/pipermail/smallwiki/2006-March/001773.html
> http://www.iam.unibe.ch/pipermail/smallwiki/2004-May/000615.html
> http://minnow.cc.gatech.edu/squeak/2318
>
> I use ReferenceStreams as follows:
>
> " save Pier kernel instance "
> stream := ReferenceStream fileNamed: 'pier-export.obj'.
> stream nextPut: (PRKernel instanceNamed: 'mykernelname') root.
> stream close.
>
> " load Pier kernel from stored objects "
> stream := ReferenceStream fileNamed: 'pier-export.obj'.
> (PRKernel instanceNamed: 'mykernelname') root: stream next.
> stream close.
>
> Brian
>
>
>>Hi all,
>>
>>The only thing which stops me to run personal wiki on Pier is the
>
> chances
>
>>that I
>>can have my image corrupted. Is there any way to make a backup of Pier
>
> content
>
>>and full restore ? If I can run it daily would be nice.
>>
>>Thanks.
>>-Dmitry.
>
>
>
>
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup + Calendar question

Dmitry Dorofeev
Hi all,

Thanks for information. It sounds positive. So I feel I can use it and have my backups done.

My goal is to have an application to store a list of events
for public view and search. While I have Pier-Forms and StellDichEin installed,
still can not see how to have a list of events sorted by date, or a nice
calendar view with my events. Creating events as separate pages would be ok,
but overall navigation become a complete mess after a month.

I am very new to Magritte and Pier and was unable to find any good docs
about it. I would program my own interface to event calendar (if such does not exist),
but need some intro or good hints where to look and how to start. Quite impressed
that I can have (in theory) an iCal compatible output for offline processing.

Please help,

-Dmitry.

David T. Lewis wrote:

> Dmitry,
>
> I mentioned in another reply in this thread that (for a unix based system)
> you can back up your entire image with "UnixProcess saveImageInBackgroundNicely".
>
> You could probably do something very similar to implement Brian's ReferenceStream
> approach in the background so that you would not need to show 'Sorry, Pier
> back up in action, please wait ...".
>
> The approach would be:
>
>  - Fork a headless Squeak (exact copy of your running Pier application)
>    using #forkHeadlessSqueakAndDoThenQuit.
>  - In the child Squeak image (the headless copy of your real server),
>    do whatever is necessary to stop serving, so your child Squeak does
>    not try to compete with the real one that is serving your users.
>  - In the child Squeak, do the ReferenceStream save as described by
>    Brian.
>
> You can think of the #forkSqueak as producing an instantanious copy
> of your running image (using the Unix fork() system call). You can
> use this copy (the headless child Squeak image) to do all of your
> backup work without impacting the real Pier server image.
> This should permit you to guarantee that Pier is not being changed
> while you do backup, and it also should prevent the backup from
> having any noticeable effect on your users.
>
> If you want to try this, I suggest as a starting point to use
> UnixProcess class >>saveImageInBackground:nice: as an example.
> Change it to use #forkHeadlessSqueakAndDoThenQuit: instead of
> #forkHeadlessSqueakAndDo:, and replace the code that does the
> image save with whatever you need to pause the Pier server and
> do the save with ReferenceStream.
>
> HTH,
> Dave
>
>
> On Fri, May 26, 2006 at 12:54:45PM +0400, Dmitry Dorofeev wrote:
>
>>Nice and easy, thanks.
>>
>>The only question left unresolved is to how ensure that nobody
>>change Pier pages while I do backup. It is not quite necessary for
>>me personally. But would be nice to have a backup/restore functionality
>>embedded into Pier. That may show nice message like 'Sorry, Pier back up is
>>action,
>>please wait and try to edit this page later.' to the user who updates the
>>page.
>>
>>Just an idea.
>>
>>-Dmitry.
>>
>>Brian Chapados wrote:
>>
>>>This topic has come up before on the Pier (smallwiki) mailing list.  Check
>>>these links:
>>>
>>># save/restore all data from a pier instance
>>>http://www.iam.unibe.ch/pipermail/smallwiki/2006-March/001773.html
>>>http://www.iam.unibe.ch/pipermail/smallwiki/2004-May/000615.html
>>>http://minnow.cc.gatech.edu/squeak/2318
>>>
>>>I use ReferenceStreams as follows:
>>>
>>>" save Pier kernel instance "
>>>stream := ReferenceStream fileNamed: 'pier-export.obj'.
>>>stream nextPut: (PRKernel instanceNamed: 'mykernelname') root.
>>>stream close.
>>>
>>>" load Pier kernel from stored objects "
>>>stream := ReferenceStream fileNamed: 'pier-export.obj'.
>>>(PRKernel instanceNamed: 'mykernelname') root: stream next.
>>>stream close.
>>>
>>>Brian
>>>
>>>
>>>
>>>>Hi all,
>>>>
>>>>The only thing which stops me to run personal wiki on Pier is the
>>>
>>>chances
>>>
>>>
>>>>that I
>>>>can have my image corrupted. Is there any way to make a backup of Pier
>>>
>>>content
>>>
>>>
>>>>and full restore ? If I can run it daily would be nice.
>>>>
>>>>Thanks.
>>>>-Dmitry.
>>>
>>>
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>Seaside mailing list
>>>[hidden email]
>>>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>_______________________________________________
>>Seaside mailing list
>>[hidden email]
>>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup + Calendar question

Lukas Renggli
> My goal is to have an application to store a list of events
> for public view and search. While I have Pier-Forms and StellDichEin installed,
> still can not see how to have a list of events sorted by date, or a nice
> calendar view with my events. Creating events as separate pages would be ok,
> but overall navigation become a complete mess after a month.

This is a question to ask in the Pier mailing-list, register at
<https://www.iam.unibe.ch/mailman/listinfo/smallwiki>.

> I am very new to Magritte and Pier and was unable to find any good docs
> about it. I would program my own interface to event calendar (if such does not exist),
> but need some intro or good hints where to look and how to start. Quite impressed
> that I can have (in theory) an iCal compatible output for offline processing.

See <http://smallwiki.unibe.ch/smallwiki/pier/>.

There was a group of students developing a calendar application for
Pier last year, including todo-lists, iCal import/export, day-, week-,
month-views, etc. Unfortunately nobody kept the code updated to run on
the latest version, so there will be some work required. You can
check-out the code from:

MCHttpRepository
    location: 'http://kilana.unibe.ch:8888/SW2Calendar'
    user: ''
    password: ''

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pier backup + Calendar question

Lukas Renggli
Begin forwarded message:

From: "Philippe Marschall" <[hidden email]>
Date: 28 May 2006 13:20:20 GMT+02:00
To: "SmallWiki, Magritte, Pier and Related Tools ..." <[hidden email]>
Subject: Re: [Seaside] Pier backup + Calendar question
Reply-To: "SmallWiki, Magritte, Pier and Related Tools ..."
<[hidden email]>

Hi

You are absolutely right about StellDichEin it has no good way of
dealing with multiple events.

For searching I think the Pier search engine should work because the
way I understood it is that it works on any kind of (Magritte
described) structure, not only pages.
Note that you can link to events the same way you can link to pages.

A sorted list of events should be quite simple with the help of an
MAReport. Either by creating a new kind of structure or adding a new
ViewCommand.

The calendar view is actually the biggest problem (and the nicest to
have). I see several ways to do this.
One is to port the rendering code of SW2Calendar
(http://www.squeaksource.com/SW2Calendar/) done by David Röthlisberger
and Vera Fischer. This code actually worked some time ago (about a
year) when Pier was called SmallWiki 2.
A second would be to nag Avi into making his calendar rendering code public ;)

An other option would be to write a magrittefied interface to the
Google Calendar (http://code.google.com/apis/gdata/calendar.html) and
embed it into Pier.
This should not be so hard, because the protocol is REST + POX (Well
there is of course the problem with HTTP clients in Squeak) (makes you
wonder why they didn't use iCal for that, but oh well). But then
events would no longer be structures and Google would be responsible
for the storage. You would probably still want to use the iCal package
for the creation and editing of objects and the Magritte UI before you
convert them to XML.

There is actually some kind of Documentation about Magritte and Pier
http://smallwiki.unibe.ch/smallwiki/pier
http://lukas-renggli.ch/smalltalk/magritte
http://lukas-renggli.ch/smalltalk/pier
The last thing I heard is that Lukas should/must/... be finished with
his master thesis pretty damn soon. ;) This - although it probably
will be a bit lengthy - should also help.

About StellDichEin:
The SDE* classes are basically wrappers about the iCal classes (mostly
ICEvent and ICTodo modeled very close to the iCal spec
http://www.ietf.org/rfc/rfc2445.txt). Form within Squeak you can talk
to them using normal messages. The user interface is built with
Magritte (descriptions are provided with the ICalMagritte package).
Export to iCal is done by creating an ICCalendar add what you need and
pass it to an ICCalendarExporter.

More specific questions would help me to give more specific answers ;)

Cheers
Philippe

2006/5/26, Dmitry Dorofeev <[hidden email]>:
Hi all,

Thanks for information. It sounds positive. So I feel I can use it and
have my backups done.

My goal is to have an application to store a list of events
for public view and search. While I have Pier-Forms and StellDichEin installed,
still can not see how to have a list of events sorted by date, or a nice
calendar view with my events. Creating events as separate pages would be ok,
but overall navigation become a complete mess after a month.

I am very new to Magritte and Pier and was unable to find any good docs
about it. I would program my own interface to event calendar (if such
does not exist),
but need some intro or good hints where to look and how to start.
Quite impressed
that I can have (in theory) an iCal compatible output for offline processing.

Please help,

-Dmitry.

David T. Lewis wrote:
Dmitry,

I mentioned in another reply in this thread that (for a unix based system)
you can back up your entire image with "UnixProcess
saveImageInBackgroundNicely".

You could probably do something very similar to implement Brian's
ReferenceStream
approach in the background so that you would not need to show 'Sorry, Pier
back up in action, please wait ...".

The approach would be:

 - Fork a headless Squeak (exact copy of your running Pier application)
   using #forkHeadlessSqueakAndDoThenQuit.
 - In the child Squeak image (the headless copy of your real server),
   do whatever is necessary to stop serving, so your child Squeak does
   not try to compete with the real one that is serving your users.
 - In the child Squeak, do the ReferenceStream save as described by
   Brian.

You can think of the #forkSqueak as producing an instantanious copy
of your running image (using the Unix fork() system call). You can
use this copy (the headless child Squeak image) to do all of your
backup work without impacting the real Pier server image.
This should permit you to guarantee that Pier is not being changed
while you do backup, and it also should prevent the backup from
having any noticeable effect on your users.

If you want to try this, I suggest as a starting point to use
UnixProcess class >>saveImageInBackground:nice: as an example.
Change it to use #forkHeadlessSqueakAndDoThenQuit: instead of
#forkHeadlessSqueakAndDo:, and replace the code that does the
image save with whatever you need to pause the Pier server and
do the save with ReferenceStream.

HTH,
Dave


On Fri, May 26, 2006 at 12:54:45PM +0400, Dmitry Dorofeev wrote:

Nice and easy, thanks.

The only question left unresolved is to how ensure that nobody
change Pier pages while I do backup. It is not quite necessary for
me personally. But would be nice to have a backup/restore functionality
embedded into Pier. That may show nice message like 'Sorry, Pier back up is
action,
please wait and try to edit this page later.' to the user who updates the
page.

Just an idea.

-Dmitry.

Brian Chapados wrote:

This topic has come up before on the Pier (smallwiki) mailing list.  Check
these links:

# save/restore all data from a pier instance
http://www.iam.unibe.ch/pipermail/smallwiki/2006-March/001773.html
http://www.iam.unibe.ch/pipermail/smallwiki/2004-May/000615.html
http://minnow.cc.gatech.edu/squeak/2318

I use ReferenceStreams as follows:

" save Pier kernel instance "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
stream nextPut: (PRKernel instanceNamed: 'mykernelname') root.
stream close.

" load Pier kernel from stored objects "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
(PRKernel instanceNamed: 'mykernelname') root: stream next.
stream close.

Brian



Hi all,

The only thing which stops me to run personal wiki on Pier is the

chances


that I
can have my image corrupted. Is there any way to make a backup of Pier

content


and full restore ? If I can run it daily would be nice.

Thanks.
-Dmitry.






_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside