Thursday 28 February 2013

Taking Backup and restore sharepoint in command line

Taking site backup and restoring using STSADM is probably the easiest and fastest one.
Backup the site using the following STSADM Command:

stsadm -o backup -url http://mysite/ -filename backup-filename.bak

Create a new Web Application for restoring the site:Go to Central Administration -> Application Management -> under SharePoint Web Application Management -> click Create or Extend Web Application. Fill in the required information, click Ok and wait until the progress continues.

Once the new web application is created, run the following STSADM command and restore the site using the backup file created above.

stsadm -o restore -url http://myothersite/ -filename backup-filename.bak

For some reason we needed to create an empty web application and a site collection first, and restore on top of that using the -overwrite option of stsadm.exe,

This backup/restore command can only used for site collection back up/restore.
If it is a single site, export/import command is using instead of backup/restore

Difference B/W Sequential Workflow and State Machine Workflow

Sequential Workflow:
- It looks very simple like flow chart.
- Steps within the workflow execute sequentially, one after another in the particular order.
- A sequential workflow always progresses forward, never going back to a previous step.
- Sequential workflows are definitely much easier to design and maintain.

State machine Workflow:
- A state machine workflow executes in no particular order and these are based on events like OnTaskCreated, OnTaskDeleted etc.
- A state machine workflow moves from one state to another until the logic concludes the workflow has completed.
- Compared to Sequential workflows State machine workflows are difficult to design and maintain.
- In order to move to another event, the workflow needs to meet another state.
- The workflow doesn’t really have to end. It can stay in the same state for weeks.
Visual studio provides both Sequential workflow and State Machine workflow. But in SharePoint designer you can only make sequential workflows.

There are some business process that requires a state machine workflow like for example: a bug tracking system where When the workflow first starts, the bug may be placed in a Pending state, where it waits for a developer to be assigned and start working on the bug. When the developer starts working on the bug and fixes it, the bug is put into a Fixed state. When the bug is fixed, a tester confirms the resolution of the bug. If it is not fixed, he places the bug back in a Pending state.
So you should decide the type before developing the workflow. Because it will be very difficult to change once you have started that workflow.

Sequential workflow should used when there is only one way to complete a task and the workflow controls the process. But state machine workflow can stay in a same step for a longer period of time, must not be in an end state. State machine does not have any specified path, they are event driven.