code: def migrate_class(session, cls, source, destination):
      
      if not isinstance(session, Session):
          raise TypeError('session must be an instance of sqlalchemy.orm.'
                          'session.Session, not ' + repr(session))
      elif not isinstance(cls, DeclarativeMeta):
          raise TypeError('cls must be an instance of sqlalchemy.'
                          'ext.declarative.api.DeclarativeMeta, not ' +
                          repr(cls))
      elif not isinstance(source, Store):
          raise TypeError('source must be an instance of sqlalchemy_imageattach'
                          '.store.Store, not ' + repr(source))
      elif not isinstance(destination, Store):
          raise TypeError('destination must be an instance of '
                          'sqlalchemy_imageattach.store.Store, not ' +
                          repr(source))
  
      @MigrationPlan
      def result():
          for instance in session.query(cls):
              with source.open(instance) as f:
                  destination.store(instance, f)
                  yield instance
      return result
docs: Migrate all image data of ``cls`` from ``source`` storage to
      ``destination`` storage.  All data in ``source`` storage are *not*
      deleted.
  
      It does not execute migration by itself alone.  You need to
      :meth:`~MigrationPlan.execute()` the plan it returns::
  
          migrate_class(session, UserPicture, source, destination).execute()
  
      Or iterate it using :keyword:`for` statement::
  
          for i in migrate_class(session, UserPicture, source, destination):
              # i is an image just done migration
              print(i)
  
      :param session: SQLAlchemy session
      :type session: :class:`sqlalchemy.orm.session.Session`
      :param cls: declarative mapper class
      :type cls: :class:`sqlalchemy.ext.declarative.api.DeclarativeMeta`
      :param source: the storage to copy image data from
      :type source: :class:`~sqlalchemy_imageattach.store.Store`
      :param destination: the storage to copy image data to
      :type destination: :class:`~sqlalchemy_imageattach.store.Store`
      :returns: iterable migration plan which is not executed yet
      :rtype: :class:`MigrationPlan`