=head1 NAME

OpenResty::Spec::Upgrading - Upgrading to new versions of OpenResty server

=head1 SYNOPSIS

    # upgrade metamodel
    $ bin/openresty upgrade foo
    $ bin/openresty upgrade

=head1 DESCRIPTION

New versions of OpenResty server often contain modifications to the metamodel which is the data structure used by the server itself. So in order to run a newer version of OpenResty atop the database used to work with an older one, it's often required to upgrade the metamodel first. Basically it's as easy as

    $ bin/openresty upgrade

This command will upgrade both the global metamodel (in the _global schema) as well as the local metamodel in all the OpenResty accounts' schemas. (See L<OpenResty::Spec::MetaModel> for more details about the MetaModel.)

It's also possible to upgrade just a specified OpenResty account without upgrading either the global metamodel or other accounts. Just give the account name to the "upgrade" command:

    $ bin/openresty upgrade foo

where C<foo> is the account which we want to upgrade exclusively.

Note that it's highly recommended to use only the CPAN release for upgrading. The SVN head might contain some half-done MetaModel changes which may corrupt you metamodel in the database later.

If you're a developer, however, the use of the SVN head is certainly encouraged ;)

In case the upgrading failed (it should not happen often), one might have to fix the failure himself. A metamodel recovering tool is in our TODO list though.

=head1 AUTHOR

Agent Zhang (agentzh) C<< <agentzh@gmail.com >>

=head1 SEE ALSO

L<OpenResty::Spec::MetaModel>, L<OpenResty>.

